summaryrefslogtreecommitdiffstats
path: root/docs/html
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:43 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:43 -0800
commitf013e1afd1e68af5e3b868c26a653bbfb39538f8 (patch)
tree7ad6c8fd9c7b55f4b4017171dec1cb760bbd26bf /docs/html
parente70cfafe580c6f2994c4827cd8a534aabf3eb05c (diff)
downloadframeworks_base-f013e1afd1e68af5e3b868c26a653bbfb39538f8.zip
frameworks_base-f013e1afd1e68af5e3b868c26a653bbfb39538f8.tar.gz
frameworks_base-f013e1afd1e68af5e3b868c26a653bbfb39538f8.tar.bz2
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'docs/html')
-rwxr-xr-xdocs/html/community/groups.jd98
-rw-r--r--docs/html/community/index.jd91
-rw-r--r--docs/html/guide/appendix/faq/commontasks.jd129
-rw-r--r--docs/html/guide/appendix/faq/framework.jd38
-rw-r--r--docs/html/guide/appendix/faq/licensingandoss.jd2
-rw-r--r--[-rwxr-xr-x]docs/html/guide/appendix/faq/troubleshooting.jd20
-rw-r--r--docs/html/guide/appendix/g-app-intents.jd5
-rw-r--r--docs/html/guide/appendix/glossary.jd392
-rw-r--r--docs/html/guide/appendix/index.jd4
-rw-r--r--docs/html/guide/basics/android-sdk.jd11
-rw-r--r--docs/html/guide/basics/app-framework.jd4
-rw-r--r--docs/html/guide/basics/appmodel.jd17
-rw-r--r--docs/html/guide/basics/index.jd58
-rw-r--r--[-rwxr-xr-x]docs/html/guide/basics/what-is-android.jd18
-rw-r--r--docs/html/guide/developing/aapt.jd20
-rw-r--r--docs/html/guide/developing/adb.jd668
-rwxr-xr-xdocs/html/guide/developing/aidl.jd301
-rw-r--r--docs/html/guide/developing/ddms.jd250
-rw-r--r--docs/html/guide/developing/debug-tasks.jd41
-rw-r--r--docs/html/guide/developing/develop-and-debug.jd675
-rw-r--r--docs/html/guide/developing/draw9patch.jd61
-rw-r--r--docs/html/guide/developing/eclipse-adt.jd7
-rwxr-xr-xdocs/html/guide/developing/emulator.jd1724
-rw-r--r--docs/html/guide/developing/hierarchy-viewer.jd99
-rw-r--r--docs/html/guide/developing/instrumentation/index.jd6
-rw-r--r--docs/html/guide/developing/instrumentation/inst-framework.jd32
-rw-r--r--docs/html/guide/developing/instrumentation/inst-testing.jd29
-rw-r--r--docs/html/guide/developing/monkey.jd240
-rw-r--r--docs/html/guide/developing/other-ide.jd30
-rwxr-xr-xdocs/html/guide/developing/othertools.jd104
-rw-r--r--docs/html/guide/developing/tools.jd112
-rw-r--r--docs/html/guide/developing/tools/adb.jd49
-rw-r--r--docs/html/guide/developing/tools/adt.jd154
-rw-r--r--docs/html/guide/developing/tools/adt_download.jd65
-rw-r--r--[-rwxr-xr-x]docs/html/guide/developing/tools/aidl.jd9
-rw-r--r--docs/html/guide/developing/tools/ddms.jd16
-rw-r--r--docs/html/guide/developing/tools/draw9patch.jd11
-rw-r--r--[-rwxr-xr-x]docs/html/guide/developing/tools/emulator.jd148
-rw-r--r--docs/html/guide/developing/tools/hierarchy-viewer.jd5
-rw-r--r--docs/html/guide/developing/tools/index.jd116
-rw-r--r--docs/html/guide/developing/tools/monkey.jd4
-rw-r--r--[-rwxr-xr-x]docs/html/guide/developing/tools/othertools.jd8
-rw-r--r--docs/html/guide/developing/tools/traceview.jd6
-rw-r--r--docs/html/guide/developing/traceview.jd310
-rw-r--r--docs/html/guide/guide_toc.cs188
-rw-r--r--docs/html/guide/index.jd62
-rw-r--r--docs/html/guide/practices/design/responsiveness.jd2
-rw-r--r--docs/html/guide/practices/design/seamlessness.jd2
-rw-r--r--docs/html/guide/publishing/app-signing.jd489
-rw-r--r--docs/html/guide/publishing/preparing.jd252
-rw-r--r--docs/html/guide/publishing/publishing.jd250
-rw-r--r--docs/html/guide/publishing/versioning.jd135
-rw-r--r--docs/html/guide/samples/index.jd8
-rw-r--r--docs/html/guide/topics/data/contentproviders.jd608
-rw-r--r--docs/html/guide/topics/data/data-storage.jd107
-rw-r--r--docs/html/guide/topics/data/index.html9
-rw-r--r--docs/html/guide/topics/drawing/index.html9
-rw-r--r--docs/html/guide/topics/fundamentals.jd1411
-rw-r--r--docs/html/guide/topics/graphics/2d-graphics.jd459
-rw-r--r--docs/html/guide/topics/graphics/index.jd21
-rw-r--r--docs/html/guide/topics/graphics/opengl.jd56
-rw-r--r--docs/html/guide/topics/intents/index.html9
-rw-r--r--docs/html/guide/topics/intents/intents-filters.jd562
-rw-r--r--docs/html/guide/topics/location/geo/mapkey.jd28
-rw-r--r--docs/html/guide/topics/location/index.jd109
-rw-r--r--docs/html/guide/topics/manifest/manifest.jd3212
-rw-r--r--docs/html/guide/topics/media/index.jd188
-rw-r--r--docs/html/guide/topics/media/media.jd1
-rw-r--r--docs/html/guide/topics/providers/content-providers.jd271
-rw-r--r--docs/html/guide/topics/resources/available-resources.jd434
-rw-r--r--docs/html/guide/topics/resources/index.jd40
-rw-r--r--[-rwxr-xr-x]docs/html/guide/topics/resources/resources-i18n.jd93
-rw-r--r--docs/html/guide/topics/security/security.jd37
-rw-r--r--docs/html/guide/topics/sensors/accelerometer.jd18
-rw-r--r--docs/html/guide/topics/sensors/camera.jd18
-rw-r--r--docs/html/guide/topics/sensors/compass.jd18
-rw-r--r--docs/html/guide/topics/sensors/index.jd13
-rw-r--r--docs/html/guide/topics/views/binding.jd56
-rw-r--r--docs/html/guide/topics/views/custom-components.jd563
-rw-r--r--docs/html/guide/topics/views/custom-views.jd148
-rw-r--r--docs/html/guide/topics/views/declaring-layout.jd228
-rw-r--r--docs/html/guide/topics/views/how-android-draws.jd90
-rw-r--r--docs/html/guide/topics/views/index.jd235
-rw-r--r--docs/html/guide/topics/views/intro.jd (renamed from docs/html/guide/topics/views/hierarchy.jd)4
-rw-r--r--docs/html/guide/topics/views/layout.jd177
-rw-r--r--docs/html/guide/topics/views/themes.jd137
-rw-r--r--docs/html/guide/topics/views/ui-events.jd94
-rw-r--r--docs/html/guide/topics/views/ui-xml.jd2
-rw-r--r--docs/html/guide/topics/wireless/bluetooth.jd18
-rw-r--r--docs/html/guide/topics/wireless/index.jd19
-rw-r--r--docs/html/guide/topics/wireless/wifi.jd18
-rw-r--r--docs/html/guide/tutorials/hello-world.jd350
-rw-r--r--docs/html/guide/tutorials/images/hello_world_0.pngbin32885 -> 30614 bytes
-rw-r--r--docs/html/guide/tutorials/images/hello_world_1.pngbin42372 -> 38174 bytes
-rw-r--r--docs/html/guide/tutorials/images/hello_world_2.pngbin76964 -> 67830 bytes
-rw-r--r--docs/html/guide/tutorials/images/hello_world_3.pngbin60105 -> 60750 bytes
-rw-r--r--docs/html/guide/tutorials/images/hello_world_4.pngbin62820 -> 61711 bytes
-rw-r--r--docs/html/guide/tutorials/images/hello_world_5.pngbin10022 -> 6244 bytes
-rw-r--r--docs/html/guide/tutorials/images/hello_world_8.pngbin23668 -> 10993 bytes
-rw-r--r--docs/html/guide/tutorials/images/hello_world_9.pngbin38390 -> 25933 bytes
-rw-r--r--docs/html/guide/tutorials/notepad/index.jd142
-rw-r--r--docs/html/guide/tutorials/notepad/notepad-ex1.jd38
-rw-r--r--docs/html/guide/tutorials/notepad/notepad-ex2.jd22
-rw-r--r--docs/html/guide/tutorials/notepad/notepad-ex3.jd17
-rw-r--r--docs/html/guide/tutorials/notepad/notepad-extra-credit.jd12
-rw-r--r--docs/html/guide/tutorials/views/hello-autocomplete.jd4
-rw-r--r--docs/html/guide/tutorials/views/hello-datepicker.jd4
-rw-r--r--docs/html/guide/tutorials/views/hello-formstuff.jd3
-rw-r--r--docs/html/guide/tutorials/views/hello-gallery.jd4
-rw-r--r--docs/html/guide/tutorials/views/hello-gridview.jd3
-rw-r--r--docs/html/guide/tutorials/views/hello-linearlayout.jd4
-rw-r--r--docs/html/guide/tutorials/views/hello-listview.jd3
-rw-r--r--docs/html/guide/tutorials/views/hello-mapview.jd42
-rw-r--r--docs/html/guide/tutorials/views/hello-relativelayout.jd6
-rw-r--r--docs/html/guide/tutorials/views/hello-spinner.jd3
-rw-r--r--docs/html/guide/tutorials/views/hello-tablelayout.jd5
-rw-r--r--docs/html/guide/tutorials/views/hello-tabwidget.jd124
-rw-r--r--docs/html/guide/tutorials/views/hello-timepicker.jd4
-rw-r--r--docs/html/guide/tutorials/views/hello-webview.jd3
-rw-r--r--docs/html/guide/tutorials/views/images/hello-tabwidget.pngbin0 -> 2117 bytes
-rw-r--r--docs/html/guide/tutorials/views/index.jd (renamed from docs/html/guide/tutorials/views/hello-views-index.jd)14
-rw-r--r--docs/html/images/activity_lifecycle.pngbin65850 -> 66148 bytes
-rw-r--r--[-rwxr-xr-x]docs/html/images/draw9patch-bad.pngbin20089 -> 20089 bytes
-rw-r--r--[-rwxr-xr-x]docs/html/images/draw9patch-norm.pngbin21841 -> 21841 bytes
-rw-r--r--docs/html/images/hello_world_9.pngbin25933 -> 28538 bytes
-rw-r--r--[-rwxr-xr-x]docs/html/images/hierarchyviewer-layout.pngbin49085 -> 49085 bytes
-rw-r--r--[-rwxr-xr-x]docs/html/images/hierarchyviewer-pixelperfect.pngbin72830 -> 72830 bytes
-rw-r--r--docs/html/images/layoutparams.pngbin40397 -> 42180 bytes
-rw-r--r--docs/html/images/mediaplayer_state_diagram.gifbin0 -> 23582 bytes
-rw-r--r--docs/html/images/mediarecorder_state_diagram.gifbin20271 -> 21124 bytes
-rw-r--r--docs/html/images/service_lifecycle.pngbin0 -> 59286 bytes
-rw-r--r--[-rwxr-xr-x]docs/html/images/zippy_bullet.gifbin52 -> 52 bytes
-rw-r--r--[-rwxr-xr-x]docs/html/images/zippy_closed.gifbin56 -> 56 bytes
-rw-r--r--[-rwxr-xr-x]docs/html/images/zippy_open.gifbin54 -> 54 bytes
-rw-r--r--docs/html/index.jd109
-rw-r--r--docs/html/sdk/1.0_r1/RELEASENOTES.jd541
-rw-r--r--docs/html/sdk/1.0_r1/download.jd26
-rw-r--r--docs/html/sdk/1.0_r1/download_list.jd49
-rw-r--r--docs/html/sdk/1.0_r1/download_previous.jd188
-rw-r--r--docs/html/sdk/1.0_r1/installing.jd211
-rw-r--r--docs/html/sdk/1.0_r1/requirements.jd40
-rw-r--r--docs/html/sdk/1.0_r1/sdk_toc.cs1
-rw-r--r--docs/html/sdk/1.0_r1/upgrading.jd22
-rw-r--r--docs/html/sdk/sdk_toc.cs38
-rw-r--r--docs/html/sdk/terms.jd (renamed from docs/html/sdk/1.0_r1/terms_body.html)8
-rwxr-xr-xdocs/html/search.jd15
146 files changed, 10898 insertions, 8252 deletions
diff --git a/docs/html/community/groups.jd b/docs/html/community/groups.jd
deleted file mode 100755
index 9d6a2d7..0000000
--- a/docs/html/community/groups.jd
+++ /dev/null
@@ -1,98 +0,0 @@
-community=true
-page.title=Groups
-@jd:body
-
- <div id="mainBodyFixed">
- <div id="mainBodyLeft">
- <h3>Android Discussion Groups</h3>
- <p>Welcome to the Android community! We're glad you're here and invite you to participate in these discussions. Before posting, please red the <a href="#">Groups Charter</a> that covers the community guidelines.</p>
- <p>To get the most out of this group, please do the following before you post:</p>
- <div class="indent">
- <p><strong>1.</strong> <a href="community_2.html">Read the FAQs</a> The most common questions are addressed in this frequently updated list.</p>
- <p><strong>2.</strong> <strong>Type in keywords of your questions in the main Android site's search bar</strong> (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>
- <p><strong>3.</strong> <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. Also <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.
- </p>
- </div>
- <p>For a great guide to phrasing your questions, please read: <a href="#">How to Ask Questions The Smart Way</a>.</p>
- <br /><br />
- </div>
-
- <div id="mainBodyRight">
- <table>
- <tr>
- <td class="blueBorderBox">
- <h3 class="green">News</h3>
- <a href="community_2.html" class="orangeLink">Developers get hands on unlocked phones</a>
- <h4>mobile.google.com</h4>
- <br />
-
- <a href="community_2.html" class="orangeLink">Google announces availability of Google Mobile products on T-Mobile G1</a>
- <h4>mobile.google.com</h4>
- <br />
-
- <a href="community_2.html" class="orangeLink">Android 1.0 SDK R1 now available</a>
- <h4>android-developers.com</h4>
- <br />
-
- <a href="community_2.html" class="orangeLink">Android Market Announcement</a>
- <h4>market.android.com</h4>
- <br />
- </td>
- </tr>
- </table>
- </div>
- </div>
- <div id="mainBodyBottom">
- <h3>Available Groups</h3>
- <br />
- <table class="groupTable">
- <tr>
- <th>Group - Web Access</th>
- <th>Description</th>
- <th>Subscribe by email</th>
- </tr>
- <tr class="oddRow">
- <td><a href="#">android-beginners</a></td>
- <td>Discuss developing Android applications using the Android framework. Get help with troubleshooting apps, advice on implementation, and strategies for improving your app's speed and user experience.</td>
- <td><a href="#">android-beginners-subscribe@googlegroups.com</a></td>
- </tr>
- <tr class="evenRow">
- <td><a href="#">android-developers</a></td>
- <td>New to ANdroid development? Start here. Open to any discussion around beginner-type questions; this is a great way to get up and running with your new App on the Android platform.</td>
- <td><a href="#">android-developers-subscribe@googlegroups.com</a></td>
- </tr>
- <tr class="oddRow">
- <td><a href="#">android-internals</a></td>
- <td>For "hackers" interested in discussing the innards of Android or exploring its use on various hardware.</td>
- <td><a href="#">android-internals-subscribe@googlegroups.com</a></td>
- </tr>
- <tr class="evenRow">
- <td><a href="#">android-discuss</a></td>
- <td>The "water cooler" of Android discussion. Free-wheeling discussion from ideas about the Android platform to your announcements on other Android resources.</td>
- <td><a href="#">android-discuss-subscribe@googlegroups.com</a></td>
- </tr>
- <tr class="oddRow">
- <td><a href="#">android-security-discuss</a></td>
- <td>A place for open discussion on secure development, emerging security concerns, and best practices for and by android developers.</td>
- <td><a href="#">android-security-discuss@googlegroups.com</a></td>
- </tr>
- <tr class="evenRow">
- <td><a href="#">android-security-announce</a></td>
- <td>A low-volume group for security-related announcements by the Android Security Team.</td>
- <td><a href="#">android-security-announce-subscribe@googlegroups.com</a></td>
- </tr>
- </table>
- <br /><br />
-
-
- <h3 class="green">Subscribing to Groups via Email</h3>
- <img src="images/hr_gray_main.jpg" />
- <p><br />You can also subscribe to these groups through email and handle your posts with your email client of choice.</p>
- <p>To do so, either:</p>
- <ol>
- <li>Use the ink under "subscribe b email" in the table above to bypass the web interface altogether.</li>
- <li>If you're already signed in to the groups via the web, simply click "edit my membership" on the right hand side and choose "email" under "How do you want to read this group?"</li>
- </ol>
- <p>&nbsp;</p>
- <p>&nbsp;</p>
- </div> \ No newline at end of file
diff --git a/docs/html/community/index.jd b/docs/html/community/index.jd
index eadd94d..e59cb3b 100644
--- a/docs/html/community/index.jd
+++ b/docs/html/community/index.jd
@@ -2,46 +2,55 @@ community=true
page.title=Community
@jd:body
-<div id="mainBodyFixed">
- <div id="mainBodyLeft">
- <div id="communityDiv">
- <h2>Latest News</h2>
- <br /><br />
+ <div id="mainBodyFixed">
+ <h1>Community</h1>
+ <p>Welcome to the Android community! We're glad you're here and invite you to participate in these discussions. Before posting, please red the <a href="#">Groups Charter</a> that covers the community guidelines.</p>
+ <p>To get the most out of this group, please do the following before you post:</p>
+ <ol>
+ <li><a href="{@docRoot}guide/appendix/faq/index.html">Read the FAQs</a> The most common questions are addressed in this frequently updated list.</li>
+ <li><strong>Type in keywords of your questions in the main Android site's search bar</strong> (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><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. Also <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.</li>
+ </ol>
+ <p>For a great guide to phrasing your questions, please read: <a href="#">How to Ask Questions The Smart Way</a>.</p>
- <a href="groups.html" class="orangeLink">Developers get hands on unlocked phones</a>
- <p>mobile.google.com</p>
- <br />
-
- <a href="groups.html" class="orangeLink">Google announces availability of Google Mobile products on T-Mobile G1</a>
- <p>mobile.google.com</p>
- <br />
-
- <a href="groups.html" class="orangeLink">Android 1.0 SDK R1 now available</a>
- <p>android-developers.com</p>
- <br />
-
- <a href="groups.html" class="orangeLink">Android Market Announcement</a>
- <p>market.android.com</p>
- <br />
- </div>
- </div>
-
- <div id="mainBodyRight">
- <table id="rightColumn">
- <tr>
- <td>
- <h2 class="green">Mailing Lists</h2>
- <p><a href="groups.html">android-beginners</a></p>
- <p><a href="groups.html">android-developers</a></p>
- <p><a href="groups.html">android-internals</a></p>
- <p><a href="groups.html">android-discuss</a></p>
- <p><a href="groups.html">android-security-discuss</a></p>
- <p><a href="groups.html">android-security-announce</a></p>
- </td>
- </tr>
- <tr>
- <td colspan="2"><div class="seperator">&nbsp;</div></td>
- </tr>
- </table>
- </div>
+<h2>Subscribe to a Group</h2>
+<p>You can subscribe to these groups in one of two ways:</p>
+ <ul>
+ <li>Follow the web access link (in the first column below) and then click "Join this group" on the right-side of the Groups page. If you'd rather read posts via email, sign in to Groups and click "edit my membership" on the right hand side. Select "email" under "How do you want to read this group?".</li>
+ <li>Or simply subscribe via email by clicking the subscribe link (in the last column below).</li>
+ </ul>
+
+<h3 class="green">Available Groups</h3>
+ <table class="groupTable">
+ <tr>
+ <th>Group - Web Access</th>
+ <th>Description</th>
+ <th>Subscribe by email</th>
+ </tr>
+ <tr class="oddRow">
+ <td><a href="http://groups.google.com/group/android-beginners">android-beginners</a></td>
+ <td>Discuss developing Android applications using the Android framework. Get help with troubleshooting apps, advice on implementation, and strategies for improving your app's speed and user experience.</td>
+ <td><a href="mailto:android-beginners-subscribe@googlegroups.com">android-beginners-subscribe@googlegroups.com</a></td>
+ </tr>
+ <tr class="evenRow">
+ <td><a href="http://groups.google.com/group/android-developers">android-developers</a></td>
+ <td>New to ANdroid development? Start here. Open to any discussion around beginner-type questions; this is a great way to get up and running with your new App on the Android platform.</td>
+ <td><a href="mailto:android-developers-subscribe@googlegroups.com">android-developers-subscribe@googlegroups.com</a></td>
+ </tr>
+ <tr class="oddRow">
+ <td><a href="http://groups.google.com/group/android-discuss">android-discuss</a></td>
+ <td>The "water cooler" of Android discussion. Free-wheeling discussion from ideas about the Android platform to your announcements on other Android resources.</td>
+ <td><a href="mailto:android-discuss-subscribe@googlegroups.com">android-discuss-subscribe@googlegroups.com</a></td>
+ </tr>
+ <tr class="evenRow">
+ <td><a href="http://groups.google.com/group/android-security-discuss">android-security-discuss</a></td>
+ <td>A place for open discussion on secure development, emerging security concerns, and best practices for and by android developers.</td>
+ <td><a href="mailto:android-security-discuss-subscribe@googlegroups.com">android-security-discuss-subscribe@googlegroups.com</a></td>
+ </tr>
+ <tr class="oddRow">
+ <td><nobr><a href="http://groups.google.com/group/android-security-announce">android-security-announce</a></nobr></td>
+ <td>A low-volume group for security-related announcements by the Android Security Team.</td>
+ <td><a href="mailto:android-security-announce-subscribe@googlegroups.com">android-security-announce-subscribe@googlegroups.com</a></td>
+ </tr>
+ </table>
</div> \ No newline at end of file
diff --git a/docs/html/guide/appendix/faq/commontasks.jd b/docs/html/guide/appendix/faq/commontasks.jd
index cdc7654..69fddd3 100644
--- a/docs/html/guide/appendix/faq/commontasks.jd
+++ b/docs/html/guide/appendix/faq/commontasks.jd
@@ -16,7 +16,7 @@ page.title=Common Tasks and How to Do Them in Android
<li><a href="#configurewindowproperties">Configuring general window properties </a></li>
<li><a href="#localhostalias">Referring to localhost from the emulated environment</a></li>
<li><a href="#appstate">Storing and retrieving state</a></li>
- <li><a href="{@docRoot}devel/data/preferences.html">Storing and retrieving preferences</a></li>
+ <li><a href="{@docRoot}guide/topics/data/data-storage.html#preferences">Storing and retrieving preferences</a></li>
<li><a href="#storingandretrieving">Storing and retrieving larger or more complex
persistent data</a> (files and data) </li>
<li><a href="#playback">Playing audio, video, still, or other media files</a></li>
@@ -36,34 +36,43 @@ page.title=Common Tasks and How to Do Them in Android
<li><a href="#filelist">List of files for an Android application</a></li>
<li><a href="#logging">Print messages to a log file</a></li>
</ul>
-<p>The ApiDemos sample application includes
- many, many examples of common tasks and UI features. See the code inside samples/ApiDemos and
- the other sample applications under the samples/ folder in the
- SDK.</p>
+<p>The ApiDemos sample application includes many, many examples of common
+tasks and UI features. See the code inside
+<code>&lt;sdk&gt;samples/ApiDemos</code> and the other sample applications
+under the <code>samples/</code> folder in the SDK.</p>
+
+
+<h2 id="neweclipseandroidproject">Creating an Android Application using the Eclipse Plugin</h2>
-<a name="neweclipseandroidproject" id="neweclipseandroidproject"></a><h2>Creating an Android Application using the Eclipse Plugin</h2>
<p>Using the Android Eclipse plugin is the fastest and easiest way
to start creating a new Android application. The plugin automatically generates
the correct project structure for your application, and keeps the resources
compiled for you automatically.</p>
-<p>It is still a good idea to know what is going on though. Take a look at
-<a href="{@docRoot}intro/anatomy.html">Overview of an Android Application</a> to understand
-the basics of how an Android application works.</p>
-<p>It is also recommended that you take a look at the
-ApiDemos application and the other
-sample applications in the samples/ folder in the SDK.</p>
+
+<p>It is still a good idea to know what is going on though. Take a look at <a
+href="{@docRoot}guide/topics/fundamentals.html">Application Fundamentals</a>
+to understand the basics of how an Android application works.</p>
+
+<p>You should also take a look at the ApiDemos application and the other sample
+applications included in the SDK, in the <code>&lt;sdk&gt;/samples/
+folder in the SDK.</p>
+
<p>Finally, a great way to started with Android development in Eclipse is to
-follow both the <a href="{@docRoot}intro/hello-android.html">Hello Android</a> and
-<a href="{@docRoot}intro/tutorial.html">Notepad</a> code tutorials. In particular, the start
-of the Hello Android tutorial is an excellent introduction to creating a new
-Android application in Eclipse.</p>
+follow both the <a href="{@docRoot}guide/tutorials/hello-world.html">Hello,
+World</a> and <a
+href="{@docRoot}guide/tutorials/notepad/index.html">Notepad</a> code
+tutorials. In particular, the start of the Hello Android tutorial is an
+excellent introduction to creating a new Android application in Eclipse.</p>
+
+<h2 id="newandroidprojectnoeclipse">Creating an Android Application without the Eclipse Plugin</h2>
-<a name="newandroidprojectnoeclipse" id="newandroidprojectnoeclipse"></a><h2>Creating an Android Application without the Eclipse Plugin</h2>
<p>This topic describes the manual steps in creating an Android application.
- Before reading this, you should read <a href="{@docRoot}intro/anatomy.html">Overview of an Android
- Application</a> to understand the basics of how an Android application works.
- You might also want to look at the sample applications that ship with Android
- under the samples/ directory. </p>
+Before reading this, you should read <a
+href="{@docRoot}guide/topics/fundamentals.html">Application Fundamentals</a>
+to understand the basics of how an Android application works. You might also
+want to look at the sample code included with the Android SDK, in the
+<code>&lt;sdk&gt;/samples/</code> directory. </p>
+
<p>Here is a list of the basic steps in building an application.</p>
<ol>
<li><strong>Create your required resource files</strong> &nbsp;&nbsp;This includes
@@ -71,8 +80,9 @@ Android application in Eclipse.</p>
needs, and layout files describing your user interface. A full list of optional
and required files and syntax details for each is given in <a href="#filelist">File
List for an Android Application</a>. </li>
- <li><strong>Design your user interface</strong> &nbsp;&nbsp;See <a href="{@docRoot}devel/implementing-ui.html">Implementing
- a UI</a> for details on elements of the Android screen. </li>
+ <li><strong>Design your user interface</strong> &nbsp;&nbsp;See <a
+ href="{@docRoot}guide/topics/views/index.html">Implementing a UI</a> for
+ details on elements of the Android screen. </li>
<li><strong>Implement your Activity </strong>(this page)<strong>&nbsp;&nbsp; </strong> You
will create one class/file for each screen in your application. Screens will
inherit from an {@link android.app android.app} class, typically {@link android.app.Activity
@@ -85,12 +95,12 @@ Android application in Eclipse.</p>
the device, are described below.
The list of files you'll need for your application are described in <a href="#filelist">List
of Files for an Android Application</a>. </li>
- <li><strong><a href="{@docRoot}intro/installing.html#building">Build and install your
+ <li><strong><a href="{@docRoot}guide/developing/other-ide.html#buildingwithant">Build and install your
package</a>.</strong> The Android SDK has some nice tools for generating
projects and debugging code. </li>
</ol>
-<a name="addexternallibrary" id="addexternallibrary"></a><h2>Adding an External Library (.jar) using Eclipse</h2>
+<h2 id="addexternallibrary">Adding an External Library (.jar) using Eclipse</h2>
<p>
You can use a third party JAR in your application by adding it to your Eclipse project as follows:
</p>
@@ -108,11 +118,13 @@ Alternatively, if you want to include third party JARs with your package, create
It is not necessary to put external JARs in the assets folder.
</p>
-<a name="implementcallbacks" id="implementcallbacks"></a><h2>Implementing Activity Callbacks</h2>
+<a name="implementcallbacks" id="implementcallbacks"></a>
+<h2>Implementing Activity Callbacks</h2>
<p>Android calls a number of callbacks to let you draw your screen, store data before
pausing, and refresh data after closing. You must implement at least some of
- these methods. See <a href="{@docRoot}intro/lifecycle.html">Lifetime of a Screen</a> to learn
- when and in what order these methods are called. Here are some of the standard types of screen classes that Android provides:</p>
+ these methods. See <a href="{@docRoot}guide/topics/fundamentals.html#lcycles">Lifecycles</a>
+ discussion in Application Fundamentals to learn when and in what order these methods
+ are called. Here are some of the standard types of screen classes that Android provides:</p>
<ul>
<li>{@link android.app.Activity android.app.Activity} - This is a standard screen,
with no specialization.</li>
@@ -135,10 +147,12 @@ It is not necessary to put external JARs in the assets folder.
<h3>Floating or full?<a name="floatingorfull" id="floatingorfull"></a></h3>
<p>When you open a new screen you can decide whether to make it transparent or floating,
or full-screen. The choice of new screen affects the event sequence of events
- in the old screen (if the new screen obscures the old screen, a different series
- of events is called in the old screen). See <a href="{@docRoot}intro/lifecycle.html">Lifetime
- of an Activity</a> for details. </p>
-<p>Transparent or floating windows are implemented in three standard ways: </p>
+ in the old screen (if the new screen obscures the old screen, a different
+ series of events is called in the old screen). See <a
+ href="{@docRoot}guide/topics/fundamentals.html#lcycles">Lifecycles</a> discussion
+ in Application Fundamentals for details. </p>
+<p>Transparent or floating windows are implemented in three
+ standard ways: </p>
<ul>
<li>Create an {@link android.app.Dialog app.Dialog} class </li>
<li>Create an {@link android.app.AlertDialog app.AlertDialog} class </li>
@@ -186,8 +200,8 @@ startActivity(myIntent); </pre>
<p>Android defines a number of standard values, for instance the action constants
defined by {@link android.content.Intent}. You can define custom values, but
both the caller and handler must use them. See the &lt;intent-filter&gt;
- tag description in <a href="{@docRoot}devel/bblocks-manifest.html">AndroidManifest.xml
- File Details</a> for more information on the manifest syntax for the handling
+ tag description in <a href="{@docRoot}guide/topics/manifest/manifest.html">The AndroidManifest.xml
+ File</a> for more information on the manifest syntax for the handling
application. </p>
<a name="returningaresult" id="returningaresult"></a><h3>Returning a Result from a Screen</h3>
<p>A window can return a result after it closes. This result will be passed back
@@ -246,15 +260,14 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data){
finish();
}
};
-</pre>
+ </pre>
<h3>Lifetime of the new screen </h3>
<p>An activity can remove itself from the history stack by calling {@link android.app.Activity#finish()
Activity.finish()} on itself, or the activity that opened the screen can call
{@link android.app.Activity#finishActivity(int) Activity.finishActivity()}
on any screens that it opens to close them. </p>
<a name="listening" id="listening"></a><h2>Listening for Button Clicks</h2>
-<p>Button click and other UI event capturing are covered in <a href="{@docRoot}devel/ui/notifications.html">Listening
- for UI Notifications</a> on the UI Design page.</p>
+<p>Button click and other UI event capturing are covered in <a href="{@docRoot}guide/topics/views/ui-events.html">Handling UI Events</a> on the UI Design page.</p>
<a name="configurewindowproperties" id="configurewindowproperties"></a><h2>Configuring General Window Properties</h2>
<p>You can set a number of general window properties, such as whether to display
a title, whether the window is floating, and whether it displays an icon, by
@@ -287,18 +300,16 @@ loopback interface.
the application is finalized. See the topics for {@link android.app.Activity#onSaveInstanceState} and
{@link android.app.Activity#onCreate} for
examples of storing and retrieving state.</p>
-<p>Read more about the life cycle of an application in <a href="{@docRoot}intro/lifecycle.html">Lifetime
- of an Activity</a>.</p>
+<p>Read more about the lifecycle of an application in <a href="{@docRoot}guide/topics/fundamentals.html">Application Fundamentals</a>.</p>
<h3>Storing and Retrieving Larger or More Complex Persistent Data<a name="storingandretrieving" id="storingandretrieving"></a></h3>
<p>Your application can store files or complex collection objects, and reserve them
for private use by itself or other activities in the application, or it can expose
- its data to all other applications on the device. See <a href="{@docRoot}devel/data.html">Storing,
+ its data to all other applications on the device. See <a href="{@docRoot}guide/topics/data/data-storage.html">Storing,
Retrieving, and Exposing Data</a> to learn how to store and retrieve private data,
how to store and retrieve common data from the device, and how to expose your
private data to other applications.</p>
<a name="playback" id="playback"></a><h2>Playing Media Files</h2>
-<p>Please see the document <a href="{@docRoot}toolbox/apis/media.html">Android
-Media APIs</a> for more details.</p>
+<p>Please see the document <a href="{@docRoot}guide/topics/media/index.html">Audio and Video</a> for more details.</p>
<a name="broadcastreceivers" id="broadcastreceivers"></a><h2>Listening For and Broadcasting Global Messages, and Setting Alarms</h2>
<p>You can create a listening class that can be notified or even instantiated whenever
a specific type of system message is sent.
@@ -313,7 +324,7 @@ Media APIs</a> for more details.</p>
that describes the types of messages it will receive. Just as Android's IntentResolver
will look for appropriate Activity matches for a startActivity() call, it will
look for any matching Receivers (but it will send the message to all matching
- receiver, not the &quot;best&quot; match). </p>
+ receivers, not to the &quot;best&quot; match). </p>
<p>To send a notification, the caller creates an {@link android.content.Intent Intent}
object and calls {@link android.app.Activity#sendBroadcast(android.content.Intent)
Context.sendBroadcast()} with that Intent. Multiple recipients can receive
@@ -332,8 +343,7 @@ Media APIs</a> for more details.</p>
<p><em><strong>Note:</strong></em>&nbsp;&nbsp;&nbsp;If a receiver or broadcaster
enforces permissions, your application might need to request permission
to send or receive messages from that object. You can request permission by using
- the {@link android.R.styleable#AndroidManifestUsesPermission &lt;uses-permission&gt;}
- tag in the manifest. </p>
+ the &lt;uses-permission&gt; tag in the manifest. </p>
<p>Here is a code snippet of a sender and receiver. This example does not demonstrate
registering receivers dynamically. For a full code example, see the AlarmService
class in the ApiDemos project.</p>
@@ -759,8 +769,8 @@ public class MyActivity extends Activity {
};
&#64;Override
- protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
[ . . . ]
}
@@ -786,14 +796,14 @@ public class MyActivity extends Activity {
</pre>
<p>For further discussions on this topic, see
-<a href="{@docRoot}toolbox/responsiveness.html">Developing Responsive Applications</a>
+<a href="{@docRoot}guide/practices/design/responsiveness.html">Designing for Responsiveness</a>
and the {@link android.os.Handler} documentation.</p>
<a name="selectingtext" id="selectingtext"></a><h2>Selecting, Highlighting, or Styling Portions of Text</h2>
<p>You can highlight or style the formatting of strings or substrings of text in
a TextView object. There are two ways to do this:</p>
<ul>
- <li>If you use a <a href="{@docRoot}reference/available-resources.html#stringresources">string resource</a>,
+ <li>If you use a <a href="{@docRoot}guide/topics/resources/available-resources.html#stringresources">string resource</a>,
you can add some simple styling, such as bold or italic using HTML notation.
The currently supported tags are: <code>B</code> (bold),
<code>I</code> (italic), <code>U</code> (underline),
@@ -855,9 +865,8 @@ If the latitudeSpan, longitudeSpan, and zoomLevel attributes are not consistent,
<a name="filelist" id="filelist"></a><h2>List of Files for an Android Application</h2>
<p>The following list describes the structure and files of an Android application.
- Many of these files can be built for you (or stubbed out) by the activitycreator.py
- application shipped in the tools/ menu of the SDK. See <a href="{@docRoot}intro/installing.html#building">Building
- an Android Sample Application</a> for more information on using activitycreator.py. </p>
+ Many of these files can be built for you (or stubbed out) by the activitycreator
+ application shipped in the tools/ menu of the SDK. </p>
<table width="100%" border="0">
<tr>
<td width="28%" valign="top">MyApp/<br /></td>
@@ -869,7 +878,7 @@ If the latitudeSpan, longitudeSpan, and zoomLevel attributes are not consistent,
where they can be launched (from the main program menu or elsewhere),
any content providers it implements and what kind of data they handle,
where the implementation classes are, and other application-wide
- information. Syntax details for this file are described in <a href="{@docRoot}devel/bblocks-manifest.html">AndroidManifest.xml</a>.</td>
+ information. Syntax details for this file are described in <a href="{@docRoot}guide/topics/manifest/manifest.html">The AndroidManifest.xml File</a>.</td>
</tr>
<tr>
<td valign="top">&nbsp;&nbsp;&nbsp;&nbsp;src/<br />
@@ -883,14 +892,14 @@ If the latitudeSpan, longitudeSpan, and zoomLevel attributes are not consistent,
your application. Resources are external data files or description files
that are compiled into your code at build time. Files in different folders
are compiled differently, so you must put the proper resource into the
- proper folder. (See <a href="{@docRoot}devel/resources-i18n.html">Resources</a> for details.)</td>
+ proper folder. (See <a href="{@docRoot}guide/topics/resources/resources-i18n.html">Resources</a> for details.)</td>
</tr>
<tr>
<td valign="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;anim/<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>animation1</em>.xml<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>...</em></td>
<td valign="top">(<em>optional</em>) Holds any animation XML description files that the
- application uses. The format of these files is described in <a href="{@docRoot}devel/resources-i18n.html">Resources</a>. </td>
+ application uses. The format of these files is described in <a href="{@docRoot}guide/topics/resources/resources-i18n.html">Resources</a>. </td>
</tr>
<tr>
<td valign="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;drawable/<br />
@@ -904,7 +913,7 @@ If the latitudeSpan, longitudeSpan, and zoomLevel attributes are not consistent,
graphics such as bitmaps, stretchable bitmaps, or gradients. Supported
bitmap file formats are PNG (preferred), JPG, and GIF (discouraged),
as well as the custom 9-patch stretchable bitmap format. These formats
- are described in <a href="{@docRoot}devel/resources-i18n.html">Resources</a>. </td>
+ are described in <a href="{@docRoot}guide/topics/resources/resources-i18n.html">Resources</a>. </td>
</tr>
<tr>
<td valign="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;layout/<br />
@@ -913,9 +922,7 @@ If the latitudeSpan, longitudeSpan, and zoomLevel attributes are not consistent,
<td valign="top">(<em>optional</em>) Holds all the XML files describing screens or parts
of screens. Although you could create a screen in Java, defining them
in XML files is typically easier. A layout file is similar in concept
- to an HTML file that describes the screen layout and components. See <a href="{@docRoot}devel/implementing-ui.html">Implementing a
- UI</a> for more information about designing screens, and <a href="{@docRoot}reference/available-resources.html#layoutresources">Layout
- Resources</a> for the syntax of these files.</td>
+ to an HTML file that describes the screen layout and components. See <a href="{@docRoot}guide/topics/views/index.html">Views and Layout</a> for more information about designing screens, and <a href="{@docRoot}guide/topics/resources/available-resources.html#layoutresources">Available Resource Types</a> for the syntax of these files.</td>
</tr>
<tr>
<td valign="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;values/<br />
@@ -930,7 +937,7 @@ If the latitudeSpan, longitudeSpan, and zoomLevel attributes are not consistent,
such as strings, colors, and styles. The naming, quantity, and number
of these files are not enforced--any XML file is compiled, but these
are the standard names given to these files. However, the syntax
- of these files is prescribed by Android, and described in <a href="{@docRoot}devel/resources-i18n.html">Resources</a>. </p>
+ of these files is prescribed by Android, and described in <a href="{@docRoot}guide/topics/resources/resources-i18n.html">Resources</a>. </p>
</td>
</tr>
<tr>
@@ -953,7 +960,7 @@ If the latitudeSpan, longitudeSpan, and zoomLevel attributes are not consistent,
<code>Log.w()</code>, or <code>Log.e()</code> to log messages.
(See the {@link android.util.Log} class.)<br/> E.g.,
<code>Log.e(this.toString(), "error: " + err.toString())</code></li>
- <li>Launch <a href="/android/reference/ddms.html">DDMS</a> from a terminal
+ <li>Launch <a href="{@docRoot}guide/developing/tools/ddms.html">DDMS</a> from a terminal
by executing <code>ddms</code> in your Android SDK <code>/tools</code> path.</li>
<li>Run your application in the Android emulator.</li>
<li>From the DDMS application, select the emulator
diff --git a/docs/html/guide/appendix/faq/framework.jd b/docs/html/guide/appendix/faq/framework.jd
index 48db8da..c5cfcf1 100644
--- a/docs/html/guide/appendix/faq/framework.jd
+++ b/docs/html/guide/appendix/faq/framework.jd
@@ -25,9 +25,10 @@ page.title=Android Application Framework FAQ
<h2>Do all the Activities and Services of an application run in a
single process?</h2>
-<p>All Activities and Services in an application run in a single
-process by default. The <a href="{@docRoot}reference/android/R.styleable.html#AndroidManifestActivity_process">android:process</a> attribute can be used to
-explicitly place a component (Activity/Service) in another process.</p>
+<p>All Activities and Services in an application run in a single process by
+default. If needed, you can declare an <code>android:process</code> attribute
+in your manifest file, to explicitly place a component (Activity/Service) in
+another process.</p>
<!-- ------------------------------------------------------------------ -->
@@ -58,8 +59,8 @@ application?</h2>
<p>To share primitive data between Activities/Services in an
application, use Intent.putExtras(). For passing primitive data that
needs to persist use the
-<a href="{@docRoot}devel/data/preferences.html">Application
-Preferences</a>.</p>
+<a href="{@docRoot}guide/topics/data/data-storage.html#preferences">
+Preferences</a> storage mechanism.</p>
<h3>Non-Persistent Objects</h3>
@@ -118,10 +119,11 @@ following approaches are recommended:
</ul>
</p>
-<p>If the shared data needs to be retained across points where the
-application process can be killed, then place that data in persistent
-storage like Application Preferences, SQLite DB, Files or ContentProviders. Please refer
-to the <a href="{@docRoot}devel/data.html">Storing, Retrieving and Exposing Data</a> for further details on how to use these components.</p>
+<p>If the shared data needs to be retained across points where the application
+process can be killed, then place that data in persistent storage like
+Application Preferences, SQLite DB, Files or ContentProviders. Please refer to
+the <a href="{@docRoot}guide/topics/data/data-storage.html">Data Storage</a>
+for further details on how to use these components.</p>
<!-- ------------------------------------------------------------------ -->
@@ -143,13 +145,14 @@ call.</p>
<h2>If an Activity starts a remote service, is there any way for the
Service to pass a message back to the Activity?</h2>
-<p>The remote service can define a callback interface and register
-it with the clients to callback into the clients. The
-<a href="{@docRoot}reference/android/os/RemoteCallbackList.html">RemoteCallbackList</a> provides methods to register and
-unregister clients with the service, and send and receive messages.</p>
+<p>The remote service can define a callback interface and register it with the
+clients to callback into the clients. The
+{@link android.os.RemoteCallbackList RemoteCallbackList} class provides methods to
+register and unregister clients with the service, and send and receive
+messages.</p>
-<p>The sample code for remote service callbacks is given in
-<a href="{@docRoot}samples/ApiDemos/src/com/example/android/apis/app/RemoteService.html">ApiDemos/RemoteService</a></p>
+<p>The sample code for remote service callbacks is given in <a
+href="{@docRoot}guide/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.html">ApiDemos/RemoteService</a></p>
<!-- ------------------------------------------------------------------ -->
@@ -157,9 +160,8 @@ unregister clients with the service, and send and receive messages.</p>
<h2>How to avoid getting the Application not responding dialog?</h2>
-<p>Please check the <a href="{@docRoot}toolbox/responsiveness.html">Application
-Responsiveness</a> section to design your application for
-better responsiveness:</p>
+<p>Please read the <a href="{@docRoot}guide/practices/design/responsiveness.html">Designing for Responsiveness</a>
+document.</p>
<!-- ------------------------------------------------------------------ -->
diff --git a/docs/html/guide/appendix/faq/licensingandoss.jd b/docs/html/guide/appendix/faq/licensingandoss.jd
index a907d68..98be91c 100644
--- a/docs/html/guide/appendix/faq/licensingandoss.jd
+++ b/docs/html/guide/appendix/faq/licensingandoss.jd
@@ -8,7 +8,7 @@ page.title=Android Open Source Licensing FAQ
</ul>
<a name="mirror" id="mirror"></a><h2>Where can I find the open source components of Android?</h2>
-<p>The source code for the full Android stack is available from the <a href="http://www.android.com/opensource">Android Open Source Project </a> site.
+<p>The source code for the full Android stack is available from the <a href="http://source.android.com">Android Open Source Project </a> site.
<p>Other mirrored GPL and LGPL'd components are available at <a href="http://code.google.com/p/android/downloads/list"><code>http://code.google.com/p/android/downloads/list</code></a>.</p>
<p>Notices for other licenses can be found within the SDK.</p>
diff --git a/docs/html/guide/appendix/faq/troubleshooting.jd b/docs/html/guide/appendix/faq/troubleshooting.jd
index 8096826..e10f661 100755..100644
--- a/docs/html/guide/appendix/faq/troubleshooting.jd
+++ b/docs/html/guide/appendix/faq/troubleshooting.jd
@@ -3,7 +3,7 @@ page.title=Troubleshooting
<p>Here are some tips and tricks for common Android errors. Don't forget to use the
- ddms logcat capability to get a deeper view when errors occur. See <a href="{@docRoot}guide/developing/debugging-tasks.html">Debugging Tasks</a> for more debugging tips. </p>
+ ddms logcat capability to get a deeper view when errors occur. See <a href="{@docRoot}guide/developing/debug-tasks.html">Debugging</a> for more debugging tips. </p>
<ul>
<li><a href="#installeclipsecomponents">ADT Installation Error: "requires plug-in org.eclipse.wst.sse.ui".</a></li>
<li><a href="#nodevice">ADB reports &quot;no device&quot; when an emulator is running</a></li>
@@ -61,7 +61,7 @@ that are required to install the Android plugin (wst, emf, etc...).</li>
will often not be caught by compilers, but will prevent your application
from being displayed because the intent filter will not be matched. Extra
spaces or other characters can often sneak into these strings.</li>
- <li>Did you send your .apk file to the device (<a href="{@docRoot}reference/adb.html#move">adb install</a>)?</li>
+ <li>Did you send your .apk file to the device (<a href="{@docRoot}guide/developing/tools/adb.html#move">adb install</a>)?</li>
<li>Run logcat on your device (<code>adb logcat</code>)
and then install your .apk file. Check the logcat output to see whether the
application is being installed and recognized properly. Here's sample output
@@ -78,7 +78,7 @@ D/PackageManager( 414): Activities: com.example.codelab.rssexample.MyRssReader c
compiling it.</li>
</ul>
<a name="noupdate"></a><h2>I updated my app, but the updates don't seem to be showing up on the device</h2>
- <p>Did you remember to send your .apk file to the device (<a href="{@docRoot}reference/adb.html#move">adb
+ <p>Did you remember to send your .apk file to the device (<a href="{@docRoot}guide/developing/tools/adb.html#move">adb
install</a>)?</p>
<a name="layout_wilih"></a><h2>I'm getting a &quot;Binary XML file line #2: You must supply a layout_wilih
@@ -99,9 +99,11 @@ ignored</h2>
<p>You might not have permission (or might not have requested permission) to
call this activity or receive this intent. Many standard Android activities,
such as making a call, have a permission assigned to it to prevent arbitrary
- applications from sending or receiving requests. See <a href="{@docRoot}devel/security.html">Security
- and Permissions</a> for more information on permissions, and {@link android.Manifest.permission
- Manifest.permission} for a list of permissions enforced by Android.
+ applications from sending or receiving requests. See <a
+ href="{@docRoot}guide/topics/security/security.html">Security and
+ Permissions</a> for more information on permissions, and
+ {@link android.Manifest.permission Manifest.permission} for a list of
+ standard permissions supported by the Android platform.
</p>
<a name="build"></a><h2>Help! My project won't build in Eclipse</h2>
<p>If your project doesn't build, you may notice symptoms such as new
@@ -174,7 +176,7 @@ to start with, the safest option is to run through all of them in order:</p>
<h2 id="apidemosreinstall">I can't install ApiDemos apps in my IDE because of a signing error</a></h2>
<p>The Android system requires that all applications be signed, as described in
-<a href="{@docRoot}intro/develop-and-debug.html#signing">Signing Your Applications</a>. The ApiDemos
+ <a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a>. The ApiDemos
applications included with the SDK are preinstalled on the emulator and for that reason have been
compiled and signed with a private key.</p>
@@ -209,7 +211,7 @@ commands to the emulator instance that you are targeting. To do that you can add
<pre>adb -s emulator-5556 install</pre>
-<p>For more information about adb, see the <a href="{@docRoot}reference/adb.html">Android Debug Bridge</a>
+<p>For more information about adb, see the <a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a>
documentation.</p>
@@ -236,7 +238,7 @@ C:\Users\&lt;user&gt;\AppData\Local\Android</code></li>
<p>This problem has been verified on Windows and may apply to other platforms. </p>
<p>For general information about signing Android applications, see
-<a href="{@docRoot}intro/develop-and-debug.html#signing">Signing Your Applications</a>. </p>
+<a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a>. </p>
<h2 id="addjunit">I can't run a JUnit test class in Eclipse/ADT</h2>
diff --git a/docs/html/guide/appendix/g-app-intents.jd b/docs/html/guide/appendix/g-app-intents.jd
index 15fd8d0..d4f97c8 100644
--- a/docs/html/guide/appendix/g-app-intents.jd
+++ b/docs/html/guide/appendix/g-app-intents.jd
@@ -2,7 +2,7 @@ page.title=Intents List: Invoking Google Applications on Android Devices
@jd:body
<div class="sidebox">
-For more information about intents, see the <a href="{@docRoot}guide/topics/intents/">Intents and Intent Filters</a>.
+For more information about intents, see the <a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a>.
</div>
<p>The table below lists the intents that your application can send, to invoke Google applications on Android devices in certain ways. For each action/uri pair, the table describes how the receiving Google application handles the intent. </p>
@@ -79,7 +79,8 @@ For more information about intents, see the <a href="{@docRoot}guide/topics/inte
</td>
</tr>
<tr>
- <td>Google Streetview</td> <td>google.streetview:cbll=<em>lat</em>,<em>lng</em>&amp;cbp=1,<em>yaw</em>,,<em>pitch</em>,<em>zoom</em>&amp;mz=<em>mapZoom</em>
+ <td>Google Streetview</td>
+<td>google.streetview:cbll=<em>lat</em>,<em>lng</em>&amp;cbp=1,<em>yaw</em>,,<em>pitch</em>,<em>zoom</em>&amp;mz=<em>mapZoom</em>
</td>
<td>VIEW</td>
<td>Opens the Street View application to the given location. The URI scheme is
diff --git a/docs/html/guide/appendix/glossary.jd b/docs/html/guide/appendix/glossary.jd
index 518e638..7059643 100644
--- a/docs/html/guide/appendix/glossary.jd
+++ b/docs/html/guide/appendix/glossary.jd
@@ -1,121 +1,293 @@
page.title=Glossary
@jd:body
-<style TYPE="text/css">
-dt{font-weight:bold}
-</style>
-<h1>Android Glossary</h1>
-<p>The following terms are used in these documents. </p>
-<dl>
- <dt>.apk extension </dt>
- <dd>The extension for an Android package file, which typically contains all of the files
- related to a single Android application. The file itself is a compressed collection
- of an AndroidManifest.xml file, application code (.dex files), resource
- files, and other files. A project is compiled into a single .apk file.</dd>
- <dt>.dex extension </dt>
- <dd>Android programs are compiled into .dex (Dalvik Executable) files, which
+
+<p>The list below defines some of the basic terminology of the Android platform. </p>
+ <dl>
+ <dt id="apk">.apk file</dt> <dd>Android application package file. Each
+ Android application is compiled and packaged in a single file that
+ includes all of the application's code (.dex files), resources, assets,
+ and manifest file. The application package file can have any name but
+ <em>must</em> use the <code>.apk</code> extension. For example:
+ <code>myExampleAppname.apk</code>. For convenience, an application package
+ file is often referred to as an ".apk".
+ <p>Related: <a href="#application">Application</a>.</p>
+</dd>
+
+ <dt id="dex">.dex file </dt>
+ <dd>Compiled Android application code file.
+ <p>Android programs are compiled into .dex (Dalvik Executable) files, which
are in turn zipped into a single .apk file on the device. .dex files can
be created by automatically translating compiled applications written in
the Java programming language.</dd>
- <dt>Action</dt>
+
+ <dt id="action">Action</dt>
<dd>A description of something that an Intent sender wants done. An action is
a string value assigned to an Intent. Action strings can be defined by Android
or by a third-party developer. For example, android.intent.action.VIEW
for a Web URL, or com.example.rumbler.SHAKE_PHONE for a custom application
- to vibrate the phone. </dd>
- <dt>Activity</dt>
- <dd>A single screen in an application, with supporting Java code, derived from
- the {@link android.app.Activity} class. </dd>
- <dt>adb</dt>
- <dd>Android Debug Bridge, a command-line debugging application shipped with the
+ to vibrate the phone.
+ <p>Related: <a href="#intent">Intent</a>.</p>
+ </dd>
+
+ <dt id="activity">Activity</dt>
+ <dd>A single screen in an application, with supporting Java code, derived
+ from the {@link android.app.Activity} class. Most commonly, an activity is
+ visibly represented by a full screen window that can receive and handle UI
+ events and perform complex tasks, because of the Window it uses to render
+ its window. Though an Activity is typically full screen, it can also be
+ floating or transparent.</dd>
+
+ <dt id="adb">adb</dt>
+ <dd>Android Debug Bridge, a command-line debugging application included with the
SDK. It provides tools to browse the device, copy tools on the device, and
- forward ports for debugging. See <a href="adb.html">Using adb</a> for more information. </dd>
- <dt>Application</dt>
- <dd>A collection of one or more activities, services, listeners, and intent receivers.
- An application has a single manifest, and is compiled into a single .apk
- file on the device. </dd>
- <dt>Content Provider</dt>
- <dd>A class built on {@link android.content.ContentProvider} that handles content
- query strings of a specific format to return data in a specific format.
- See <a href="{@docRoot}devel/data/contentproviders.html">Reading
- and writing data to a content provider</a> for information on using
- content providers. </dd>
- <dt>Content URI</dt>
- <dd>A type of URI. See the URI entry. </dd>
- <dt>Dalvik</dt>
- <dd>The name of Android's virtual machine. The Dalvik VM is an interpreter-only
- virtual machine that executes files in the Dalvik Executable (.dex) format,
- a format that is optimized for efficient storage and memory-mappable execution.
- The virtual machine is register-based, and it can run classes compiled by
- a Java language compiler that have been transformed into its native format
- using the included &quot;dx&quot; tool.
- The VM runs on top of Posix-compliant operating systems, which it relies
- on for underlying functionality (such as threading and low level memory management).
- The Dalvik core class library is intended to provide a familiar
- development base for those used to programming with Java Standard
- Edition, but it is geared specifically to the needs of a small mobile
- device.</dd>
- <dt>DDMS</dt>
- <dd>Dalvik Debug Monitor Service, a GUI debugging application shipped with the
- SDK. It provides screen capture, log dump, and process examination capabilities.
- See Using the <a href="{@docRoot}reference/ddms.html">Dalvik
- Debug Monitor Server</a> to learn more about this
- program. </dd>
- <dt>Drawable</dt>
- <dd>A compiled visual resource that can be used as a background, title, or other
- part of the screen. It is compiled into an {@link android.graphics.drawable}
- subclass. </dd>
- <dt>Intent</dt>
- <dd>A class ({@link android.content.Intent}) that contains several fields describing
- what a caller would like to do. The caller sends this intent to Android's
- intent resolver, which looks through the intent filters of all applications
- to find the activity most suited to handle this intent. Intent fields include
- the desired action, a category, a data string, the MIME type of the data, a handling
- class, and other restrictions. </dd>
- <dt>Intent Filter</dt>
- <dd>Activities and intent receivers include one or more filters in their manifest
- to describe what kinds of intents or messages they can handle or want to
- receive. An intent filter lists a set of requirements, such as data type,
- action requested, and URI format, that the Intent or message must fulfill.
- For activities, Android searches for the activity with the most closely matching
- valid match between the Intent and the activity filter. For messages, Android
- will forward a message to all receivers with matching intent filters. </dd>
- <dt></dt>
- <dt>Intent Receiver </dt>
- <dd>An application class that listens for messages broadcast by calling {@link
- android.content.Context#sendBroadcast(android.content.Intent) Context.sendBroadcast()}.
- For example code, see <a href="{@docRoot}kb/commontasks.html#broadcastreceivers">Listening
- for and broadcasting global messages</a>.</dd>
- <dt>Layout resource </dt>
- <dd>An XML file that describes the layout of an Activity screen. </dd>
- <dt>Manifest</dt>
- <dd>An XML file associated with each Application that describes the various activies,
- intent filters, services, and other items that it exposes. See <a href="{@docRoot}devel/bblocks-manifest.html">AndroidManifest.xml
- File Details</a>.</dd>
- <dt>Nine-patch / 9-patch / Ninepatch image</dt>
- <dd>A resizeable bitmap resource that can be used for backgrounds or other images
- on the device. See <a href="{@docRoot}reference/available-resources.html#ninepatch">Nine-Patch Stretchable
- Image</a> for more information. </dd>
- <dt>Query String</dt>
- <dd>A type of URI. See the URI entry. </dd>
- <dt>Resource</dt>
- <dd>A user-supplied XML, bitmap, or other file, entered into an application build
- process, which can later be loaded from code. Android can accept resources
- of many types; see <a href="{@docRoot}devel/resources-i18n.html">Resources</a> for a full description.
- Application-defined resources should be stored in the <code>res/</code> subfolders. </dd>
- <dt>Service</dt>
- <dd>A class that runs in the background to perform various persistent actions,
- such as playing music or monitoring network activity. </dd>
- <dt>Theme</dt>
- <dd>A set of properties (text size, background color, and so on) bundled together
- to define various default display settings. Android provides a few standard
- themes, listed in {@link android.R.style} (starting with &quot;Theme_&quot;). </dd>
- <dt>URIs</dt>
- <dd>Android uses URI strings both for requesting data (e.g., a list of contacts)
- and for requesting actions (e.g., opening a Web page in a browser). Both
- are valid URI strings, but have different values. All requests for data must
- start with the string &quot;content://&quot;. Action strings are valid URIs
- that can be handled appropriately by applications on the device; for example,
- a URI starting with &quot;http://&quot; will be handled by the browser. </dd>
-</dl>
-<p>&nbsp;</p>
+ 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>
+ for more information. </dd>
+
+ <dt id="application">Application</dt>
+ <dd>From a component perspective, an Android application consists of one
+ or more activities, services, listeners, and intent receivers. From a
+ source file perspective, an Android application consists of code,
+ resources, assets, and a single manifest. During compilation, these files
+ are packaged in a single file called an application package file (.apk).
+ <p>Related: <a href="#apk">.apk</a>, <a href="#activity">Activity</a></p></dd>
+
+ <dt id="canvas">Canvas</dt>
+ <dd>A drawing surface that handles compositing of the actual bits against
+ a Bitmap or Surface object. It has methods for standard computer drawing
+ of bitmaps, lines, circles, rectangles, text, and so on, and is bound to a
+ Bitmap or Surface. Canvas is the simplest, easiest way to draw 2D objects
+ on the screen. However, it does not support hardware acceleration, as
+ OpenGL ES does. The base class is {@link android.graphics.Canvas}.
+ <p>Related: <a href="#drawable">Drawable</a>, <a href="#opengles">OpenGL
+ ES</a>.</p></dd>
+
+ <dt id="contentprovider">Content Provider</dt>
+ <dd>A data-abstraction layer that you can use to safely expose your
+ application's data to other applications. A content provider is built on
+ the {@link android.content.ContentProvider} class, which handles content
+ query strings of a specific format to return data in a specific format.
+ See <a href="{@docRoot}guide/topics/providers/content-providers.html">
+ Content Providers</a> topic for more information.
+ <p>Related: <a href="#uri">URI Usage in Android</a></p></dd>
+
+ <dt id="dalvik">Dalvik</dt>
+ <dd>The Android platform's virtual machine. The Dalvik VM is an
+ interpreter-only virtual machine that executes files in the Dalvik
+ Executable (.dex) format, a format that is optimized for efficient storage
+ and memory-mappable execution. The virtual machine is register-based, and
+ it can run classes compiled by a Java language compiler that have been
+ transformed into its native format using the included &quot;dx&quot; tool.
+ The VM runs on top of Posix-compliant operating systems, which it relies
+ on for underlying functionality (such as threading and low level memory
+ management). The Dalvik core class library is intended to provide a
+ familiar development base for those used to programming with Java Standard
+ Edition, but it is geared specifically to the needs of a small mobile
+ device.</dd>
+
+ <dt id="ddms">DDMS</dt>
+ <dd>Dalvik Debug Monitor Service, a GUI debugging application included
+ 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/tools/ddms.html">Dalvik Debug Monitor
+ Server</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
+ simple action (such as button choice) and perhaps return a value. A dialog
+ is not intended to persist in the history stack, contain complex layout,
+ or perform complex actions. Android provides a default simple dialog for
+ you with optional buttons, though you can define your own dialog layout.
+ The base class for dialogs is {@link android.app.Dialog Dialog}.
+ <p>Related: <a href="#activity">Activity</a>.</p></dd>
+
+ <dt id="drawable">Drawable</dt>
+ <dd>A compiled visual resource that can be used as a background, title, or
+ other part of the screen. A drawable is typically loaded into another UI
+ element, for example as a background image. A drawable is not able to
+ receive events, but does assign various other properties such as "state"
+ and scheduling, to enable subclasses such as animation objects or image
+ libraries. Many drawable objects are loaded from drawable resource files
+ &mdash; xml or bitmap files that describe the image. Drawable resources
+ are compiled into subclasses of {@link android.graphics.drawable}. For
+ more information about drawables and other resources, see <a
+ href="{@docRoot}guide/topics/resources/resources-i18n.html">Resources</a>.
+ <p>Related: <a href="#resources">Resources</a>, <a href="#canvas">Canvas
+ </a></p></dd>
+
+ <dt id="intent">Intent</dt>
+ <dd>An message object that you can use to launch or communicate with other
+ applications/activities asynchronously. An Intent object is an instance of
+ {@link android.content.Intent}. It includes several criteria fields that you can
+ supply, to determine what application/activity receives the Intent and
+ what the receiver does when handling the Intent. Available criteria include
+ include the desired action, a category, a data string, the MIME type of
+ the data, a handling class, and others. An application sends
+ an Intent to the Android system, rather than sending it directly to
+ another application/activity. The application can send the Intent to a
+ single target application or it can send it as a broadcast, which can in
+ turn be handled by multiple applications sequentially. The Android system
+ 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
+ Intent Filters</a>.
+ <p>Related: <a href="#intentfilter">Intent Filter</a>, <a
+ href="#broadcastreceiver">Broadcast Receiver</a>.</p></dd>
+
+ <dt id="intentfilter">Intent Filter</dt>
+ <dd>A filter object that an application declares in its manifest file, to
+ tell the system what types of Intents each of its components is willing to
+ accept and with what criteria. Through an intent filter, an application
+ can express interest in specific data types, Intent actions, URI formats,
+ and so on. When resolving an Intent, the system evaluates all of the
+ 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
+ Intent Filters</a>.
+ <p>Related: <a href="#intent">Intent</a>, <a
+ href="#broadcastreceiver">Broadcast Receiver</a>.</p></dd>
+
+ <dt id="broadcastreceiver">Broadcast Receiver </dt>
+ <dd>An application class that listens for Intents that are broadcast,
+ rather than being sent to a single target application/activity. The system
+ delivers a broadcast Intent to all interested broadcast receivers, which
+ handle the Intent sequentially.
+ <p>Related: <a href="#intent">Intent</a>, <a href="#intentfilter">Intent
+ Filter</a>.</p> </dd>
+
+ <dt id="layoutresource">Layout Resource</dt>
+ <dd>An XML file that describes the layout of an Activity screen.
+ <p>Related: <a href="#resources">Resources</a></p></dd>
+
+ <dt id="manifest">Manifest File</dt>
+ <dd>An XML file that each application must define, to describe the
+ application's package name, version, components (activities, intent
+ filters, services), imported libraries, and describes the various
+ activies, and so on. See <a
+ href="{@docRoot}guide/topics/manifest/manifest.html">The
+ AndroidManifest.xml File</a> for complete information.</dd>
+
+ <dt id="ninepatch">Nine-patch / 9-patch / Ninepatch image</dt>
+ <dd>A resizeable bitmap resource that can be used for backgrounds or other
+ images on the device. See <a
+ href="{@docRoot}guide/topics/resources/available-resources.html#ninepatch">
+ Nine-Patch Stretchable Image</a> for more information.
+ <p>Related: <a href="#resources">Resources</a>.</p></dd>
+
+ <dt id="opengles">OpenGL ES</dt>
+ <dd> Android provides OpenGL ES libraries that you can use for fast,
+ complex 3D images. It is harder to use than a Canvas object, but
+ better for 3D objects. The {@link android.opengl} and
+ {@link javax.microedition.khronos.opengles} packages expose
+ OpenGL ES functionality.
+ <p>Related: <a href="#canvas">Canvas</a>, <a href="#surface">Surface</a></p></dd>
+
+ <dt id="resources">Resources</dt>
+ <dd>Nonprogrammatic application components that are external to the
+ compiled application code, but which can be loaded from application code
+ using a well-known reference format. Android supports a variety of
+ resource types, but a typical application's resources would consist of UI
+ strings, UI layout components, graphics or other media files, and so on.
+ An application uses resources to efficiently support localization and
+ varied device profiles and states. For example, an application would
+ include a separate set of resources for each supported local or device
+ type, and it could include layout resources that are specific to the
+ current screen orientation (landscape or portrait). For more information
+ about resources, see <a
+ href="{@docRoot}guide/topics/resources/index.html"> Resources and
+ Assets</a>. The resources of an application are always stored in the
+ <code>res/*</code> subfolders of the project. </dd>
+
+ <dt id="service">Service</dt>
+ <dd>An object of class {@link android.app.Service} that runs in the
+ background (without any UI presence) to perform various persistent
+ actions, such as playing music or monitoring network activity.
+ <p>Related: <a href="#activity">Activity</a></p></dd>
+
+ <dt id="surface">Surface</dt>
+ <dd>An object of type {@link android.view.Surface} representing a block of
+ memory that gets composited to the screen. A Surface holds a Canvas object
+ for drawing, and provides various helper methods to draw layers and resize
+ the surface. You should not use this class directly; use
+ {@link android.view.SurfaceView} instead.
+ <p>Related: <a href="#canvas">Canvas</a></p></dd>
+
+ <dt id="surfaceview">SurfaceView</dt>
+ <dd>A View object that wraps a Surface for drawing, and exposes methods to
+ specify its size and format dynamically. A SurfaceView provides a way to
+ draw independently of the UI thread for resource-intensive operations
+ (such as games or camera previews), but it uses extra memory as a result.
+ SurfaceView supports both Canvas and OpenGL ES graphics. The base class is
+ {@link android.view.SurfaceView}.
+ <p>Related: <a href="#canvas">Surface</a></p></dd>
+
+ <dt id="theme">Theme</dt>
+ <dd>A set of properties (text size, background color, and so on) bundled
+ together to define various default display settings. Android provides a
+ few standard themes, listed in {@link android.R.style} (starting with
+ &quot;Theme_&quot;). </dd>
+
+ <dt id="uri">URIs in Android</dt>
+ <dd>Android uses URI strings as the basis for requesting data in a content
+ provider (such as to retrieve a list of contacts) and for requesting
+ actions in an Intent (such as opening a Web page in a browser). The URI
+ scheme and format is specialized according to the type of use, and an
+ application can handle specific URI schemes and strings in any way it
+ wants. Some URI schemes are reserved by system components. For example,
+ requests for data from a content provider must use the
+ <code>content://</code>. In an Intent, a URI using an <code>http://</code>
+ scheme will be handled by the browser. </dd>
+
+ <dt id="view">View</dt>
+ <dd>An object that draws to a rectangular area on the screen and handles
+ click, keystroke, and other interaction events. A View is a base class for
+ most layout components of an Activity or Dialog screen (text boxes,
+ windows, and so on). It receives calls from its parent object (see
+ viewgroup, below)to draw itself, and informs its parent object about where
+ and how big it would like to be (which may or may not be respected by the
+ parent). For more information, see {@link android.view.View}.
+ <p>Related: <a href="#viewgroup">Viewgroup</a>, <a href="#widget">Widget
+ </a></p></dd>
+
+ <dt id="viewgroup">Viewgroup</dt>
+ <dd> A container object that groups a set of child Views. The viewgroup is
+ responsible for deciding where child views are positioned and how large
+ they can be, as well as for calling each to draw itself when appropriate.
+ Some viewgroups are invisible and are for layout only, while others have
+ an intrinsic UI (for instance, a scrolling list box). Viewgroups are all
+ in the {@link android.widget widget} package, but extend
+ {@link android.view.ViewGroup ViewGroup}.
+ <p>Related: <a href="#view">View</a></p></dd>
+
+ <dt id="widget">Widget</dt>
+ <dd>One of a set of fully implemented View subclasses that render form
+ elements and other UI components, such as a text box or popup menu.
+ Because a widget is fully implemented, it handles measuring and drawing
+ itself and responding to screen events. Widgets are all in the
+ {@link android.widget} package. </dd>
+
+ <!--
+ <dt id="panel">Panel</dt>
+ <dd> A panel is a concept not backed by a specific class. It is a View of
+ some sort that is tied in closely to a parent window, but can handle
+ clicks and perform simple functions related to its parent. A panel floats
+ in front of its parent, and is positioned relative to it. A common example
+ of a panel (implemented by Android) is the options menu available to every
+ screen. At present, there are no specific classes or methods for creating
+ a panel &mdash; it's more of a general idea. </dd>
+-->
+
+ <dt id="panel">Window</dt>
+ <dd>In an Android application, an object derived from the abstract class
+ {@link android.view.Window} that specifies the elements of a generic
+ window, such as the look and feel (title bar text, location and content of
+ menus, and so on). Dialog and Activity use an implementation of this class
+ to render a window. You do not need to implement this class or use windows
+ in your application. </dd>
+
+</dl> \ No newline at end of file
diff --git a/docs/html/guide/appendix/index.jd b/docs/html/guide/appendix/index.jd
index 4ad5e5b..6b25e34 100644
--- a/docs/html/guide/appendix/index.jd
+++ b/docs/html/guide/appendix/index.jd
@@ -6,8 +6,8 @@ page.title=Appendix
<dd>A list of media codecs included in the Android platform.</dd>
<dt><a href="g-app-intents.html">Intents List: Invoking Google Applications on Android Devices</a></dt>
<dd>Intents you can send to invoke Google applications on Android devices.</dd>
- <dt><a href="faq/">FAQs, Tips, and How-to</a></dt>
+ <dt><a href="faq/index.html">FAQs, Tips, and How-to</a></dt>
<dd>How to get things done in Android.</dd>
<dt><a href="glossary.html">Glossary</a></dt>
- <dd>Glossary of Android terms.</dd>
+ <dd>Glossary of Android terminology.</dd>
</dl>
diff --git a/docs/html/guide/basics/android-sdk.jd b/docs/html/guide/basics/android-sdk.jd
new file mode 100644
index 0000000..d1f3437
--- /dev/null
+++ b/docs/html/guide/basics/android-sdk.jd
@@ -0,0 +1,11 @@
+page.title=The Android SDK
+@jd:body
+
+<p>FIXME</p>
+
+<p>The downloadable Android SDK includes the Android API libraries, sample code, documentation,
+and a collection of Android development tools, like the emulator and debugger.</p>
+
+<p>The SDK supports developing on Linux, Mac OS X, and Windows (XP and Vista).</p>
+
+<p>The Java Development Kit is required.</p> \ No newline at end of file
diff --git a/docs/html/guide/basics/app-framework.jd b/docs/html/guide/basics/app-framework.jd
new file mode 100644
index 0000000..8513884
--- /dev/null
+++ b/docs/html/guide/basics/app-framework.jd
@@ -0,0 +1,4 @@
+page.title=The Application Framework
+@jd:body
+
+TODO \ No newline at end of file
diff --git a/docs/html/guide/basics/appmodel.jd b/docs/html/guide/basics/appmodel.jd
index af5f037..323fc9b 100644
--- a/docs/html/guide/basics/appmodel.jd
+++ b/docs/html/guide/basics/appmodel.jd
@@ -168,13 +168,18 @@ or <code>singleTask</code> launch mode when using this approach, so that
the current instance is given the new intent instead of requiring that it
be destroyed and a new instance started.</p>
-<p>Another approach you can take is to set the notification activity's task
-affinity to the empty string "" (indicating no affinity) and setting the
-{@link android.R.styleable#AndroidManifestActivity_finishOnTaskLaunch
-finishOnBackground} attribute. This approach is useful if you would like the notification
+<p>Another approach you can take is to set the notification activity's
+<code>android:taskAffinity</code> to the empty string "" (indicating no affinity)
+and setting the
+<code>{@link android.R.styleable#AndroidManifestActivity_noHistory
+android:noHistory}</code> and
+<code>{@link android.R.styleable#AndroidManifestActivity_excludeFromRecents
+android:excludeFromRecents}</code> attributes.
+This approach is useful if you would like the notification
to take the user to a separate activity describing it, rather than return
-to the application's task. By specifying this attribute, the activity will
-be finished whether the user leaves it with BACK or HOME; if the attribute
+to the application's task. By specifying these attributes, the activity will
+be finished whether the user leaves it with BACK or HOME and it will not
+show up in the recent tasks list; if the <code>noHistory</code> attribute
isn't specified, pressing HOME will result in the activity and its task
remaining in the system, possibly with no way to return to it.</p>
diff --git a/docs/html/guide/basics/index.jd b/docs/html/guide/basics/index.jd
deleted file mode 100644
index e1bbc52..0000000
--- a/docs/html/guide/basics/index.jd
+++ /dev/null
@@ -1,58 +0,0 @@
-page.title=Developing Applications
-@jd:body
-<h1>Developing Android Applications</h1>
-<p>You can develop Android applications with the same high-quality tools you
-use to develop Java applications. The Android core libraries provide the
-functionality needed to build some amazingly rich mobile applications, and
-the Android development tools make running, debugging, and testing your
-applications a snap.</p>
-
-<p>This section explains the ins and outs of developing Android
-applications. It outlines the philosophy
-behind the system and then describes each of the
-key subsystems in detail. After reading this section, you'll have the knowledge
-and confidence to begin writing that real-world Android app you have in
-mind.</p>
-
-<p>Before reading this section you should read the <a
-href="{@docRoot}intro/index.html">Getting Started Guide</a>, which helps you get
-up and running with the Android SDK and shows you how to build a basic
-app. This section builds on the information in the Getting Started
-section.</p>
-
-<p>Here's the content you'll find in this section:</p>
-
-<dl>
- <dt><a href="{@docRoot}devel/implementing-ui.html">Implementing a UI</a></dt>
- <dd>Explains how to construct and interact with user interfaces for Android
- applications. After reading this page you'll have a solid understanding of
- how Android layouts are built, how they operate at runtime, and how you can
- make them pretty.</dd>
- <dt><a href="{@docRoot}devel/building-blocks.html">Building Blocks</a></dt>
- <dd>Detailed descriptions of Android components. Covers the ins and outs
- of the components summarized in Anatomy of an Android App, plus more. This
- section goes into detail on each of the key Android components (Intents,
- Activities, Views, and events.)</dd>
- <dt><a href="{@docRoot}devel/data.html">Storing and Retrieving Data</a></dt>
- <dd>How to read and write data to the various storage mechanisms
- provided by Android, and to network services. There are several
- different ways to read and write data from an Android application,
- each aimed at different needs. This page describes them all and
- explains how to pick the right one for your needs.</dd>
- <dt><a href="{@docRoot}devel/security.html">Security Model</a></dt>
- <dd>Gaining access to secure system resources and features, and
- declaring permissions to control access to your own secure features.
- Permissions control whether a given application is able to access
- piece of functionality provided by another application (for example,
- which applications can dial the phone). This page describes how
- permissions work and how to request permissions as well as define your
- own.</dd>
- <dt><a href="{@docRoot}devel/resources-i18n.html">Resources and i18n</a></dt>
- <dd>Detailed descriptions of Android's application-resource management
- system, including how it's used for internationalization and
- localization. "Resources" are application assets (such as images,
- localized strings, and XML layouts) that need to be resolved at
- runtime. This page describes how Android resolves which resource to
- load from a selection of them, as well as how to create and use
- resources.</dd>
-</dl>
diff --git a/docs/html/guide/basics/what-is-android.jd b/docs/html/guide/basics/what-is-android.jd
index 926b433..9e2801a 100755..100644
--- a/docs/html/guide/basics/what-is-android.jd
+++ b/docs/html/guide/basics/what-is-android.jd
@@ -58,23 +58,23 @@ 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}reference/view-gallery.html">Views</a> that can be used to
+ href="{@docRoot}guide/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}devel/data/contentproviders.html">Content
+ <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}devel/resources-i18n.html">Resource Manager</a>,
- providing access to non-code resources such as localized strings, graphics,
- and layout files</li>
+ 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
- life cycle of applications and provides a common navigation backstack</li>
+ lifecycle of applications and provides a common navigation backstack</li>
</ul>
-<p>For more details and a walkthrough of an application, see <a
-href="{@docRoot}intro/tutorial.html">Writing an Android Application</a>.</p>
+<p>For more details and a walkthrough of an application, see the <a
+href="{@docRoot}guide/tutorials/notepad/index.html">Notepad Tutorial</a>.</p>
<a name="libraries" id="libraries"></a>
<h2>Libraries</h2>
diff --git a/docs/html/guide/developing/aapt.jd b/docs/html/guide/developing/aapt.jd
deleted file mode 100644
index 40a209d..0000000
--- a/docs/html/guide/developing/aapt.jd
+++ /dev/null
@@ -1,20 +0,0 @@
-page.title=Using aapt
-@jd:body
-
-<p><strong>aapt</strong> stands for Android Asset Packaging Tool and is included in the <code>tools/</code> directory of the SDK. This tool allows you to view, create, and update Zip-compatible archives (zip, jar, apk). It can also compile resources into binary assets.
-</p>
-<p>
-Though you probably won't often use <strong>aapt</strong> directly, build scripts and IDE plugins can utilize this tool to package the apk file that constitutes an Android application.
-</p>
-<p>
-For more usage details, open a terminal, go to the <code>tools/</code> directory, and run the command:
-</p>
-<ul>
- <li><p>Linux or Mac OS X:</p>
- <pre>./aapt</pre>
- </li>
- <li><p>Windows:</p>
- <pre>aapt.exe</pre>
- </li>
-</ul>
-
diff --git a/docs/html/guide/developing/adb.jd b/docs/html/guide/developing/adb.jd
deleted file mode 100644
index 25b5e29..0000000
--- a/docs/html/guide/developing/adb.jd
+++ /dev/null
@@ -1,668 +0,0 @@
-page.title=Android Debug Bridge
-@jd:body
-
-<p>Android Debug Bridge (adb) is a versatile tool that lets you manage the state of a device or <a href="{@docRoot}reference/emulator.html">emulator</a>. </p>
-
-<p>Some of ways you can use adb include:</p>
-
-<ul>
-<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>
-<p>The sections below introduce adb and describe many of its common uses. </p>
-
-<h2>Contents</h2>
-<dl>
-<dt><a href="#overview">Overview</a></dt>
-<dt><a href="#issuingcommands">Issuing adb Commands</a></dt>
-<dt><a href="#devicestatus">Querying for Emulator/Device Instances</a></dt>
-<dt><a href="#directingcommands">Directing Commands to a Specific Emulator/Device Instance</a></dt>
-<dt><a href="#move">Installing an Application</a></dt>
-<dt><a href="#forwardports">Forwarding Ports</a></dt>
-<dt><a href="#copyfiles">Copying Files to or from an Emulator/Device Instance</a></dt>
-<dt><a href="#commandsummary">Listing of adb Commands </a></dt>
-<dt><a href="#shellcommands">Issuing Shell Commands</a></dt>
- <dd><a href="#sqlite">Examining sqlite3 Databases from a Remote Shell</a></dd>
- <dd><a href="#monkey">UI/Application Exerciser Monkey</a></dd>
- <dd><a href="#othershellcommands">Other Shell Commands</a></dd>
-<dt><a href="#logcat">Enabling logcat Logging</a> </dt>
- <dd><a href="#usinglogcat">Using logcat Commands</a></dd>
- <dd><a href="#filteringoutput">Filtering Log Output</a></dd>
- <dd><a href="#outputformat">Controlling Log Output Format</a></dd>
- <dd><a href="#alternativebuffers">Viewing Alternative Log Buffers</a></dd>
- <dd><a href="#stdout">Viewing stdout and stderr</a></dd>
- <dd><a href="#logcatoptions">Listing of logcat Command Options</a></dd>
-<dt><a href="#stopping">Stopping the adb Server</a> </dt>
-</dl>
-
-<a name="overview"></a>
-
-<h2>Overview</h2>
-
-<p>The adb tool 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>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&mdash;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 &mdash; an even-numbered port for console connections and an odd-numbered port for adb connections. For example: </p>
-
-<blockquote>
-Emulator 1, console: 5554<br/>
-Emulator 1, adb: 5555<br>
-Emulator 2, console: 5556<br>
-Emulator 2, adb: 5557 ...
-</blockquote>
-
-<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 trasparent 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 &lt;serialNumber&gt;] &lt;command&gt; </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 &mdash; 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>&lt;type&gt;-&lt;consolePort&gt;</code>.
- Here's an example serial number: <code>emulator-5554</code></li>
- <li>State &mdash; The connection state of the instance. Three states are supported:
- <ul>
- <li><code>offline</code> &mdash; the instance is not connected to adb or is not responding.</li>
- <li><code>device</code> &mdash; 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&nbsp;&nbsp;device
-emulator-5556&nbsp;&nbsp;device
-emulator-5558&nbsp;&nbsp;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 &lt;serialNumber&gt; &lt;command&gt; </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 &lt;path_to_apk&gt;</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}reference/aapt.html">Android Asset Packaging Tool</a> (aapt). </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 &mdash; 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 &lt;remote&gt; &lt;local&gt;</pre>
-
-<p>To copy a file or directory (recursively) <em>to</em> the emulator or device, use</p>
- <pre>adb push &lt;local&gt; &lt;remote&gt;</pre>
-
-<p>In the commands, <code>&lt;local&gt;</code> and <code>&lt;remote&gt;</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&nbsp;&lt;serialNumber&gt;</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>&nbsp;</td>
-</tr>
-
-<tr>
-<td><code>version</code></td>
-<td>Prints the adb version number. </td>
-<td>&nbsp;</td>
-</tr>
-
-<tr>
-<td rowspan="3">Debug</td>
-<td ><code>logcat&nbsp;[&lt;option&gt;] [&lt;filter-specs&gt;]</code></td>
-<td>Prints log data to the screen. </td>
-<td>&nbsp;</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>&nbsp;</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:&lt;pid&gt;</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&nbsp;&lt;path-to-apk&gt;</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>&nbsp;</td>
-</tr>
-
-<tr>
-<td><code>pull&nbsp;&lt;remote&gt;&nbsp;&lt;local&gt;</code></td>
-<td>Copies a specified file from an emulator/device instance to your development computer. </td>
-<td>&nbsp;</td>
-</tr>
-
-<tr>
-<td><code>push&nbsp;&lt;local&gt;&nbsp;&lt;remote&gt;</code></td>
-<td>Copies a specified file from your development computer to an emulator/device instance. </td>
-<td>&nbsp;</td>
-</tr>
-
-<tr>
-<td rowspan="2">Ports and Networking</td>
-<td><code>forward&nbsp;&lt;local&gt;&nbsp;&lt;remote&gt;</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:&lt;portnum&gt;</code></li>
-<li><code>local:&lt;UNIX domain socket name&gt;</code></li>
-<li><code>dev:&lt;character device name&gt;</code></li>
-<li><code>jdwp:&lt;pid&gt;</code></li></ul>
-</td>
-</tr>
-
-<tr>
-<td><code>ppp&nbsp;&lt;tty&gt;&nbsp;[parm]...</code></td>
-<td>Run PPP over USB.
-<ul>
-<li><code>&lt;tty&gt;</code> &mdash; the tty for PPP stream. For example <code>dev:/dev/omap_csmi_ttyl</code>. </li>
-<li><code>[parm]... </code> &mdash 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 PDP 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 &mdash; 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 &lt;app&gt;.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>&nbsp;</td>
-</tr>
-
-<tr>
-<td><code>kill-server</code></td>
-<td>Terminates the adb server process.</td>
-<td>&nbsp;</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&nbsp;[&lt;shellCommand&gt;]</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 {&lt;serialNumber&gt;}] shell &lt;shellCommand&gt;</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 {&lt;serialNumber&gt;}] 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>&lt;package_name&gt;</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 &quot;.help&quot; for instructions
-<em>.... enter commands, then quit...</em>
-sqlite&gt; .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}reference/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}reference/ddms.html">Dalvik Debug Monitor Service</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&nbsp;[&lt;option&gt;]...&nbsp;[&lt;filter-spec&gt;]...</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>&nbsp;</td>
-</tr>
-
-<tr>
-<td><code>stop</code></td>
-<td>Stops execution of an emulator/device instance.</td>
-<td>&nbsp;</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 [&lt;option&gt;] ... [&lt;filter-spec&gt;] ...</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> &mdash; Verbose (lowest priority)</li>
- <li><code>D</code> &mdash; Debug</li>
- <li><code>I</code> &mdash; Info</li>
- <li><code>W</code> &mdash; Warning</li>
- <li><code>E</code> &mdash; Error</li>
- <li><code>F</code> &mdash; Fatal</li>
- <li><code>S</code> &mdash; 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>&lt;priority&gt;/&lt;tag&gt;</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 &mdash; 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 &mdash; 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> &mdash; Display priority/tag and PID of originating process (the default format).</li>
- <li><code>process</code> &mdash; Display PID only.</li>
- <li><code>tag</code> &mdash; Display the priority/tag only. </li>
- <li><code>thread</code> &mdash; Display process:thread and priority/tag only. </li>
- <li><code>raw</code> &mdash; Display the raw log message, with no other metadata fields.</li>
- <li><code>time</code> &mdash; Display the date, invocation time, priority/tag, and PID of the originating process.</li>
- <li><code>long</code> &mdash; 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 &lt;format&gt;]</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> &mdash; View the buffer that contains radio/telephony related messages.</li>
-<li><code>events</code> &mdash; View the buffer containing events-related messages.</li>
-<li><code>main</code> &mdash; View the main log buffer (default)</li>
-</ul>
-
-<p>The usage of the <code>-b</code> option is:</p>
-
-<pre>[adb] logcat [-b &lt;buffer&gt;]</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&nbsp;&lt;buffer&gt;</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&nbsp;&lt;filename&gt;</code></td>
-<td>Writes log message output to <code>&lt;filename&gt;</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&nbsp;&lt;count&gt;</code></td>
-<td>Sets the maximum number of rotated logs to <code>&lt;count&gt;</code>. The default value is 4. Requires the <code>-r</code> option. </td>
-</tr>
-
-<tr>
-<td><code>-r&nbsp;&lt;kbytes&gt;</code></td>
-<td>Rotates the log file every <code>&lt;kbytes&gt;</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&nbsp;&lt;format&gt;</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/aidl.jd b/docs/html/guide/developing/aidl.jd
deleted file mode 100755
index 145fd93..0000000
--- a/docs/html/guide/developing/aidl.jd
+++ /dev/null
@@ -1,301 +0,0 @@
-page.title=Designing a Remote Interface Using AIDL
-@jd:body
-
-<p>Since each application runs in its own process, and you can write a service that
-runs in a different process from your Application's UI, sometimes you need to pass objects
-between processes. On the Android platform, one process can not 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 object across that boundary for you.</p>
-
-<p>The code to do that marshalling is tedious to write, so we provide the AIDL tool to do it
-for you.</p>
-
-<p> AIDL (Android Interface Definition Language) is an <a
-href="http://en.wikipedia.org/wiki/Interface_description_language">IDL</a>
-language used to generate code that enables two processes on an Android-powered device
-to talk using interprocess communication (IPC). If you have code
-in one process (for example, in an Activity) that needs to call methods on an
-object in another process (for example, a Service), you would use AIDL to
-generate code to marshall the parameters.</p>
-<p>The AIDL IPC mechanism
- is interface-based, similar to COM or Corba, but lighter weight. It uses a proxy
- class to pass values between the client and the implementation. </p>
-<p>This page includes the following main topics: </p>
-<ul>
- <li><a href="#implementing">Implementing IPC Using AIDL</a></li>
- <li><a href="#calling">Calling an .aidl (IPC) Class </a></li>
-</ul>
-<h2>Implementing IPC Using AIDL <a name="implementing"></a></h2>
-<p>Follow these steps to implement an IPC service using AIDL.</p>
-<ol>
- <li><strong><a href="#aidlsyntax">Create your .aidl file</a> </strong>- This
- file defines an interface (<em>YourInterface</em>.aidl) that defines the
- methods and fields available to a client. </li>
- <li><strong>Add the .aidl file to your makefile</strong> - (the <a href="{@docRoot}intro/installing.html#developingwitheclipse">Eclipse
- plugin</a> manages this for you). Android includes the compiler, called
- AIDL, in the <code>tools/</code> directory. </li>
- <li><strong><a href="#implementtheinterface">Implement your interface methods</a></strong> -
- The AIDL compiler creates an interface in the Java programming language from your AIDL interface.
- This interface has an inner abstract class named Stub that inherits the
- interface (and implements a few additional methods necessary for the IPC
- call). You must create a class that extends <em>YourInterface</em>.Stub
- and implements the methods you declared in your .aidl file. </li>
- <li><strong><a href="#exposingtheinterface">Expose your interface to clients</a></strong> -
- If you're writing a service, you should extend {@link
- android.app.Service Service} and override {@link android.app.Service#onBind
- Service.onBind(Intent)} to return an instance of your class that implements your
- interface. </li>
-</ol>
-<h3>Create an .aidl File <a name="aidlsyntax"></a></h3>
-<p>AIDL is a simple syntax that lets you declare an interface with one or more
- methods, that can take parameters and return values. These parameters and return
- values can be of any type, even other AIDL-generated interfaces. <em>However, it
- is important to note</em> that you <em>must</em> import all non-built-in types,
- <em>even if they are defined in the same package as your interface</em>.
- Here are the data types that AIDL can support: </p>
-<ul>
- <li>Primitive Java programming language types (int, boolean, etc)
- &mdash; No <code>import</code> statement is needed. </li>
- <li>One of the following classes (no <code>import</code> statements needed):
- <ul>
- <li><strong>String</strong></li>
- <li><strong>List</strong> - All elements in the List must be one of the types
- in this list, including other AIDL-generated interfaces and
- parcelables. List may optionally be used as a "generic" class (e.g.
- List&lt;String&gt;).
- The actual concrete class that the other side will receive
- will always be an ArrayList, although the method will be generated
- to use the List interface. </li>
- <li><strong>Map</strong> - All elements in the Map must be of one of the
- types in this list, including other AIDL-generated interfaces and
- parcelables. Generic maps, (e.g. of the form Map&lt;String,Integer&gt;
- are not supported.
- The actual concrete class that the other side will receive
- will always be a HashMap, although the method will be generated
- to use the Map interface.</li>
- <li><strong>CharSequence</strong> - This is useful for the CharSequence
- types used by {@link android.widget.TextView TextView} and other
- widget objects. </li>
- </ul>
- </li>
- <li>Other AIDL-generated interfaces, which are always passed by reference.
- An <code>import</code> statement is always needed for these.</li>
- <li>Custom classes that implement the <a href="#parcelable">Parcelable
- protocol</a> and are passed by value.
- An <code>import</code> statement is always needed for these.</li>
-</ul>
-<p>Here is the basic AIDL syntax:</p>
-<pre>// My AIDL file, named <em>SomeClass</em>.aidl
-// Note that standard comment syntax is respected.
-// Comments before the import or package statements are not bubbled up
-// to the generated interface, but comments above interface/method/field
-// declarations are added to the generated interface.
-
-// Include your fully-qualified package statement.
-package com.android.sample;
-
-// See the list above for which classes need
-// import statements (hint--most of them)
-import com.android.sample.IAtmService;
-
-// Declare the interface.
-interface IBankAccountService {
-
- // Methods can take 0 or more parameters, and
- // return a value or void.
- int getAccountBalance();
- void setOwnerNames(in List&lt;String&gt; names);
-
- // Methods can even take other AIDL-defined parameters.
- BankAccount createAccount(in String name, int startingDeposit, in IAtmService atmService);
-
- // All non-Java primitive parameters (e.g., int, bool, etc) require
- // a directional tag indicating which way the data will go. Available
- // values are in, out, inout. (Primitives are in by default, and cannot be otherwise).
- // Limit the direction to what is truly needed, because marshalling parameters
- // is expensive.
- int getCustomerList(in String branch, out String[] customerList);
-}</pre>
-
-<h3>Implementing the Interface <a name="implementtheinterface"></a></h3>
-<p>AIDL generates an interface file for you with the same name as your .aidl
- file. If you are using the Eclipse plugin, AIDL will automatically be run as part of
- the build process (you don't need to run AIDL first and then build your project).
- If you are not using the plugin, you should run AIDL first. </p>
-<p>The generated interface
- includes an abstract inner class named Stub that declares all the methods
- that you declared in your .aidl file. Stub also defines a few helper methods,
- most notably asInterface(), which takes an IBinder (passed to a client's onServiceConnected()
- implementation when applicationContext.bindService() succeeds), and returns an
- instance of the interface used to call the IPC methods. See the section
- <a href="#calling">Calling an IPC Method</a> for more details on how to make this cast.</p>
-<p>To implement your interface, extend <em>YourInterface</em>.Stub,
- and implement the methods. (You can create the .aidl file and implement the stub
- methods without building between--the Android build process will process .aidl
-files before .java files.) </p>
-<p>Here is an example of implementing an interface called IRemoteService, which exposes
- a single method, getPid(), using an anonymous instance:</p>
-<pre>// No need to import IRemoteService if it's in the same project.
-private final IRemoteService.Stub mBinder = new IRemoteService.Stub(){
- public int getPid(){
- return Process.myPid();
- }
-}</pre>
-<p>A few rules about implementing your interface: </p>
-<ul>
- <li>No exceptions that you throw will be sent back to the caller.</li>
- <li>IPC calls are synchronous. If you know that an IPC service takes more than
- a few milliseconds to complete, you should not call it in the Activity/View thread,
- because it might hang the application (Android might display an &quot;Application
- is Not Responding&quot; dialog).
- Try to call them in a separate thread. </li>
- <li>Only methods are supported; you cannot declare static fields in an AIDL interface.</li>
-</ul>
-
-<h3>Exposing Your Interface to Clients<a name="exposingtheinterface" id="exposingtheinterface"></a></h3>
-<p>Now that you've got your interface implementation, you need to expose it to clients.
- This is known as &quot;publishing your service.&quot; To publish a service,
- inherit {@link android.app.Service Service} and implement {@link android.app.Service#onBind
- Service.onBind(Intent)} to return an instance of the class that implements your interface.
- Here's a code snippet of a service that exposes the IRemoteService
- interface to clients. </p>
-<pre>public class RemoteService extends Service {
-...
-{@include development/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.java exposing_a_service}
-}</pre>
-
-<a name="parcelable"></a>
-<h3>Pass by value Parameters using Parcelables</h3>
-
-<p>If you have a class that you would like to send from one process to another through
-an AIDL interface, you can do that. You must ensure that the code for your class is available
-to the other side of the IPC. Generally, that means that you're talking to a service that you
-started.</p>
-<p>There are five parts to making a class support the Parcelable protocol:</b>
-<ol>
-<li>Make your class implement the {@link android.os.Parcelable} interface.</li>
-<li>Implement the method <code>public void writeToParcel(Parcel out)</code> that takes the
-current state of the object and writes it to a parcel.</li>
-<li>Implement the method <code>public void readFromParcel(Parcel in)</code> that reads the
-value in a parcel into your object.</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>Last but not least:
-<ul>
-<li>If you are developing with Eclipse/ADT, follow these steps:
-<ol type="a">
-<li>In the Package Explorer view, right-click on the project.</li>
-<li>Choose <strong>Android Tools</strong> > <strong>Create Aidl preprocess file
-for Parcelable classes</strong>.</li>
-<li>This will create a file called "project.aidl" in the root of the project.
-The file will be automatically used when compiling an aidl file that uses the
-parcelable classes.</li>
-</ol>
-</li>
-<li>If you are developing with Ant or are using a custom build process, create an aidl file
-that declares your parcelable class (as shown below). If you are using a custom build process,
-do not add the aidl file to your build. Similar to a header file in C, the aidl file isn't
-compiled.</li>
-</ul>
-</li>
-</ul>
-<p>AIDL will use these methods and fields in the code it generates to marshall and unmarshall
-your objects.</p>
-<p>Here is an example of how the {@link android.graphics.Rect} class implements the
-Parcelable protocol.</p>
-
-<pre class="prettyprint">
-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&lt;Rect&gt; CREATOR = new Parcelable.Creator&lt;Rect&gt;() {
- 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>Here is Rect.aidl for this example</p>
-
-<pre class="prettyprint">
-package android.graphics;
-
-// Declare Rect so AIDL can find it and knows that it implements
-// the parcelable protocol.
-parcelable Rect;
-</pre>
-
-<p>The marshalling in the 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"><b>Warning:</b> Don't forget the security implications of receiving data from
-other processes. In this case, the rect will read four numbers from the 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}devel/security.html">Security and Permissions in Android</a> for more
-on how to keep your application secure from malware.</p>
-
-<h2>Calling an IPC Method <a name="calling"></a></h2>
-<p>Here are the steps a calling class should make to call your remote interface: </p>
-<ol>
- <li>Declare a variable of the interface type that your .aidl file defined. </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 ServiceConnection implementation. </li>
- <li>In your implementation of {@link android.content.ServiceConnection#onServiceConnected(android.content.ComponentName,android.os.IBinder)
- ServiceConnection.onServiceConnected()}, you will receive an {@link android.os.IBinder
- IBinder} instance (called <em>service</em>). 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>Here is some sample code demonstrating calling an AIDL-created service, taken
- from the Remote Activity sample in the ApiDemos project.</p>
-<p>{@sample development/samples/ApiDemos/src/com/example/android/apis/app/RemoteServiceBinding.java
- exposing_a_service}</p>
-
-
-
diff --git a/docs/html/guide/developing/ddms.jd b/docs/html/guide/developing/ddms.jd
deleted file mode 100644
index 79ae66a..0000000
--- a/docs/html/guide/developing/ddms.jd
+++ /dev/null
@@ -1,250 +0,0 @@
-page.title=Using Dalvik Debug Monitor Service (DDMS)
-@jd:body
-
-<p>Android ships with a debugging tool called the Dalvik Debug Monitor Service (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>
-
-<p>DDMS ships in the <code>tools/</code> directory of the SDK.
- Enter this directory from a terminal/console and type <code>ddms</code> (or <code>./ddms</code>
- on Mac/Linux) to run it. DDMS will work with both the emulator and a connected device. If both are
- connected and running simultaneously, DDMS defaults to the emulator.</p>
-
-<h2 id="how-ddms-works">How DDMS works</h2>
-<p>DDMS acts as a middleman to connect the IDE to the applications running on
-the device. On Android, every application runs in its own process,
-each of which hosts its own virtual machine (VM). And each process
-listens for a debugger on a different port.</p>
-
-<p>When it starts, DDMS connects to <a href="{@docRoot}reference/adb.html">adb</a> and
-starts a device monitoring service between the two, which will notify DDMS when a device is
-connected or disconnected. When a device is connected, a VM monitoring service is created
-between adb and DDMS, which will notify 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 adb,
-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>For each VM on the device, DDMS opens a port upon which it will listen for a debugger. For the first VM, DDMS listens for a debugger on port 8600, the next on 8601, and so on. When a debugger connects to one of these ports, all traffic is forwarded between the debugger and the associated VM. Debugging can then process like any remote debugging session.</p>
-
-<p>DDMS also opens another local port, the DDMS "base port" (8700, by default), upon which it also listens for a debugger. When a debugger connects to this base port, all traffic is forwarded to the VM currently selected in DDMS, so this is typically where you debugger should connect.</p>
-
-<p>For more information on port-forwarding with DDMS,
-read <a href="{@docRoot}intro/installing.html#eclipse">Configuring your IDE to attach
-to port 8700 for debugging</a>.</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 &quot;$HOME/.ddmsrc&quot;. </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="left-pane">Left Pane</h2>
-<p>The left side of the Debug Monitor shows each emulator/device currently found, with a list of
- all the VMs currently running within each.
- VMs are identified by the package name of the application it hosts.</p>
-<p>Use this list to find and attach to the VM
- running the activity(ies) that you want to debug. Next to each VM in the
- list is a &quot;debugger pass-through&quot; port (in the right-most column).
- If you connect your debugger to one of the the ports listed, you
- will be connected to the corresponding VM on the device. However, when using
- DDMS, you need only connect to port 8700, as DDMS forwards all traffic here to the
- currently selected VM. (Notice, as you select a VM in the list, the listed port includes 8700.)
- This way, there's no need to reconfigure the debugger's port each time you switch between VMs.</p>
-<p>When an application running on the device calls {@link android.os.Debug#waitForDebugger()}
- (or you select this option in the <a href="{@docRoot}intro/installing.html#additionaldebugging">developer
- options</a>), a red icon will be shown next to the client name, while it waits for the
- debugger to attach to the VM. When a debugger is connected, the icon will turn green. </p>
-<p>If you see a crossed-out bug icon, this means that the DDMS was unable to complete a
-connection between the debugger and the VM because it was unable to open the VM's local port.
-If you see this for all VMs on the device, it is likely because you have another instance of
-DDMS running (this includes the Eclipse plugin).</p>
-<p>If you see a question mark in place of an application package, this means that,
-once DDMS received the application pid from adb, it
-somehow failed to make a successful handshake with the VM process. Try restarting DDMS.</p>
-
-
-<h2 id="right-pane">Right pane</h2>
-<p>On the right side, the Debug Monitor provides tabs that display useful information
-and some pretty cool tools.</p>
-
-<h3 id="info">Info</h3>
-<p>This view shows some general information about the selected VM, including the process
- ID, package name, and VM version.</p>
-
-<h3 id="threads">Threads</h3>
-<p> The threads view has a list of threads running in the process of the target VM.
- To reduce the amount
- of data sent over the wire, the thread updates are only sent when explicitly
- enabled by toggling the &quot;threads&quot; button
- in the toolbar. This toggle is maintained per VM. This tab includes the following
- information: </p>
-<ul>
- <li> <strong>ID</strong> - a VM-assigned unique thread ID. In Dalvik, these are
- odd numbers starting from 3. </li>
- <li> <strong>Tid</strong> - the Linux thread ID. For the main thread in a process,
- this will match the process ID. </li>
- <li> <strong>Status</strong> - the VM thread status. Daemon threads are
- shown with an asterisk (*). This will be one of the following:
- <ul>
- <li> <em>running</em> - executing application code </li>
- <li> <em>sleeping</em> - called Thread.sleep() </li>
- <li> <em>monitor</em> - waiting to acquire a monitor lock </li>
- <li> <em>wait</em> - in Object.wait() </li>
- <li> <em>native</em> - executing native code </li>
- <li> <em>vmwait</em> - waiting on a VM resource </li>
- <li> <em>zombie</em> - thread is in the process of dying </li>
- <li> <em>init</em> - thread is initializing (you shouldn't see this) </li>
- <li> <em>starting</em> - thread is about to start (you shouldn't see
- this either) </li>
- </ul>
- </li>
- <li> <strong>utime</strong> - cumulative time spent executing user code, in &quot;jiffies&quot; (usually
- 10ms). Only available under Linux. </li>
- <li> <strong>stime</strong> - cumulative time spent executing system code, in &quot;jiffies&quot; (usually
- 10ms). </li>
- <li> <strong>Name</strong> - the name of the thread</li>
-</ul>
-<p> &quot;ID&quot; and &quot;Name&quot; are set when the thread is started. The remaining
- fields are updated periodically (default is every 4 seconds). </p>
-
-<h3 id="vm-heap">VM Heap</h3>
-<p> Displays some heap stats, updated during garbage collection. If, when a VM is selected,
-the VM Heap view says that heap updates are not enabled, click the "Show heap updates" button,
-located in the top-left toolbar. Back in the VM Heap view, click <strong>Cause GC</strong>
-to perform garbage collection and update the heap stats.</p>
-
-
-<h3 id="allocation-tracker">Allocation Tracker</h3>
-<p>In this view, you can track the memory allocation of each virtual machine.
-With a VM selected in the left pane, click <strong>Start Tracking</strong>, then
-<strong>Get Allocations</strong> to view all allocations since tracking started.
-The table below will be filled with all the relevant
-data. Click it again to refresh the list.</p>
-
-
-<h3 id="emulator-control">Emulator Control</h3>
-<p>With these controls, you can simulate special device states and activities.
-Features include:</p>
-<ul>
-<li><strong>Telephony Status</strong> - change the state of the phone's Voice and Data plans
- (home, roaming, searching, etc.), and simulate different kinds of network Speed and Latency
- (GPRS, EDGE, UTMS, etc.).</li>
-<li><strong>Telephony Actions</strong> - perform simulated phone calls and SMS messages to the emulator.</li>
-<li><strong>Location Controls</strong> - send mock location data to the emulator so that you can perform
- location-aware operations like GPS mapping.
-
-<p>To use the Location Controls, launch your application in the Android emulator and open DDMS.
-Click the Emulator Controls tab and scroll down to Location Controls.
-From here, you can:</p>
-<ul class="listhead">
- <li>Manually send individual longitude/latitude coordinates to the device.
- <p>Click <strong>Manual</strong>,
- select the coordinate format, fill in the fields and click <strong>Send</strong>.
- </p>
- </li>
- <li>Use a GPX file describing a route for playback to the device.
- <p>Click <strong>GPX</strong> and load the file. Once loaded,
- click the play button to playback the route for your location-aware application.</p>
- <p>When performing playback from GPX, you can adjust the speed of
- playback from the DDMS panel and control playback with the pause and skip buttons.
- DDMS will parse both the waypoints (<code>&lt;wpt></code>, in the first table),
- and the tracks (<code>&lt;trk></code>,
- in the second table, with support for multiple segments, <code>&lt;trkseg></code>,
- although they are simply
- concatenated). Only the tracks can be played. Clicking a waypoint in the first list simply
- sends its coordinate to the device, while selecting a track lets you play it.</p>
- </li>
- <li>Use a KML file describing individual placemarks for sequenced playback to the device.
- <p>Click <strong>KML</strong> and load the file. Once loaded,
- click the play button to send the coordinates to your location-aware application.</p>
- <p>When using a KML file, it is parsed for a <code>&lt;coordinates&gt;</code>
- element. The value of which should be a single
- set of longitude, latitude and altitude figures. For example:</p>
- <pre>&lt;coordinates>-122.084143,37.421972,4&lt;/coordinates></pre>
- <p>In your file, you may include multiple <code>&lt;Placemark></code> elements, each containing
- a <code>&lt;coordinates></code> element. When you do so, the collection of placemarks will
- be added as tracks. DDMS will send one placemark per second to the device.</p>
- <p>One way to generate a suitable KML file is to find a location in Google Earth.
- Right-click the location entry that appears on the left and select "Save place as..."
- with the save format set to Kml.</p>
-<p class="note"><strong>Note:</strong> DDMS does not support routes created with the
-<code>&lt;MultiGeometry>&lt;LineString>lat1, long1, lat2, long2, ....&lt;/LineString>&lt;/MultiGeometry></code> methods.
- There is also currently no support for the <code>&lt;TimeStamp></code> node inside
- the <code>&lt;Placemark></code>.
- Future releases may support timed placement and routes within a single coordinate element.</p>
- </li>
- </ul>
- <p>For <em>additional</em> methods of spoofing location-based data, see the
- <a href="{@docRoot}toolbox/apis/lbs.html">Location-based Service APIs</a> document.</p>
- </li>
-</ul>
-
-
-<!-- <h4>Event Log</h4> -->
-
-
-<h2 id="file-explorer">File Explorer</h2>
-<p>With the File Explorer, you can view the device file system and perform basic management,
-like pushing and pulling files. This circumvents using the <a href="{@docRoot}reference/adb.html">adb</a>
-<code>push</code> and <code>pull</code> commands, with a GUI experience.</p>
-<p>With DDMS open, select <strong>Device</strong> > <strong>File Explorer...</strong> to open the
-File Explorer window. You can drag-and-drop into the device directories, but cannot drag <em>out</em> of them.
-To copy files from the device, select the file and click the <strong>Pull File from Device</strong>
-button in the toolbar. To delete files, use the <strong>Delete</strong> button in the toolbar.</p>
-<p>If you're interested in using an SD card image on the emulator, you're still required to use
-the <code>mksdcard</code> command to create an image, and then mount it during emulator bootup.
-For example, from the <code>/tools</code> directory, execute:</p>
-<pre>
-<b>$</b> mksdcard 1024M ./img
-<b>$</b> emulator -sdcard ./img
-</pre>
-<p>Now, when the emulator is running, the DDMS File Explorer will be able to read and write to the
-sdcard directory. However, your files may not appear automatically. For example, if you add an
-MP3 file to the sdcard, the media player won't see them until you restart the emulator. (When restarting
-the emulator from command line, be sure to mount the sdcard again.)</p>
-<p>For more information on creating an SD card image, see the
-<a href="{@docRoot}/reference/othertools.html#mksdcard">Other Tools</a> document.</p>
-
-<h2 id="screen-capture">Screen Capture</h2>
-<p>You can capture screen images on the device or emulator by selecting <strong>Device</strong>
- &gt; <strong>Screen capture...</strong> in the menu bar, or press CTRL-S.</p>
-
-<h2 id="exploring-processes">Exploring Processes</h2>
-<p>You can see the output of <code>ps -x</code> for a specific VM by selecting <strong>Device</strong>
- &gt; <strong>Show process status</strong>... in the menu bar.</p>
-
-<h2 id="cause-a-gc-to-occur">Cause a GC to Occur</h2>
-<p>Cause garbage collection to occury by pressing the trash can button on the toolbar. </p>
-
-<h2 id="running-dumpsys-and-dumpstate">Running Dumpsys and Dumpstate on the Device (logcat)<a name="logcat" id="logcat"></a> </h2>
-<ul>
- <li>To run <strong>dumpsys</strong> (logcat) from Dalvik, select <strong>Device</strong> &gt;
- <strong>Run logcat...</strong> in the menu bar.</li>
- <li>To run <strong>dumpstate</strong> from Dalvik, select <strong>Device</strong> &gt; <strong>Dump device
- state...</strong> in the menu bar. </li>
-</ul>
-
-<h2 id="examine-radio-state">Examine Radio State</h2>
-<p>By default, radio state is not output during a standard logcat (it is a lot of
- information). To see radio information, either click <strong>Device</strong> &gt; <strong>Dump radio
- state...</strong> or run logcat as described in <a href="{@docRoot}intro/installing.html#logradio">Logging
- Radio Information</a>. </p>
-
-<h2 id="stop-a-vitrual-machine">Stop a Virtual Machine </h2>
-<p>You can stop a virtual machine by selecting <strong>Actions</strong> &gt; <strong>Halt
-VM</strong>. Pressing this button causes the VM to call <code>System.exit(1)</code>.</p>
-
-<h2 id="known-issues" style="color:#FF0000">Known issues with DDMS </h2>
-<p>DDMS has the following known limitations:</p>
-<ul>
- <li>If you connect and disconnect a debugger, ddms drops and reconnects the
- client so the VM realizes that the debugger has gone away. This will be fixed
- eventually. </li>
-</ul>
diff --git a/docs/html/guide/developing/debug-tasks.jd b/docs/html/guide/developing/debug-tasks.jd
index bd63dcf..10fb66f 100644
--- a/docs/html/guide/developing/debug-tasks.jd
+++ b/docs/html/guide/developing/debug-tasks.jd
@@ -3,12 +3,12 @@ page.title=Debugging
<p>Android has a fairly extensive set of tools to help you debug your programs: </p>
<ul>
- <li><a href="{@docRoot}reference/ddms.html"><strong>DDMS</strong></a> - A graphical program that
+ <li><a href="{@docRoot}guide/developing/tools/ddms.html"><strong>DDMS</strong></a> - A graphical program that
supports port forwarding (so you can set up breakpoints in your code in your
IDE), screen captures on the emulator, thread and stack information,
and many other features. You can also run logcat to retrieve your Log messages.
See the linked topic for more information. </li>
- <li><strong><a href="{@docRoot}reference/ddms.html#logcat">logcat</a></strong> - Dumps a log of system
+ <li><strong><a href="{@docRoot}guide/developing/tools/ddms.html#logcat">logcat</a></strong> - Dumps a log of system
messages. The messages include a stack trace when the emulator throws an error,
as well as Log messages. To run logcat, see the linked topic.
@@ -32,19 +32,19 @@ D/ActivityManager( 763): Stopping: HistoryRecord{409dbb20 com.android.home.AllAp
<code>Log.i(&quot;MyActivity&quot;, &quot;MyClass.getView()
&mdash; Requesting item number &quot; + position)</code>
<p>You can use logcat to read these messages</p></li>
- <li><strong><a href="{@docRoot}reference/traceview.html">Traceview</a> </strong>- Android can save
+ <li><strong><a href="{@docRoot}guide/developing/tools/traceview.html">Traceview</a> </strong>- Android can save
a log of method calls and times to a logging file that you can view in a
graphical reader called Traceview. See the linked topic for more information. </li>
</ul>
<ul>
- <li><a href="#developingwitheclipse"><strong>Eclipse plugin</strong></a> - The Eclipse
- Android plugin incorporates a number of these tools (ADB, DDMS, logcat output,
+ <li><a href="#developingwitheclipse"><strong>Eclipse plugin</strong></a> - The ADT Plugin
+ for Eclipse integrates a number of these tools (ADB, DDMS, logcat output,
and other functionality). See the linked topic for more information. </li>
<li><strong>Debug and Test Device Settings</strong> - Android exposes several settings
that expose useful information such as CPU usage and frame rate. See <a href="#additionaldebugging">Debug
and Test Settings on the Emulator</a> below. </li>
</ul>
-<p>Also, see the <a href="{@docRoot}kb/troubleshooting.html">Troubleshooting</a> section
+<p>Also, see the <a href="{@docRoot}guide/appendix/faq/troubleshooting.html">Troubleshooting</a> section
of the doc to figure out why your application isn't appearing on the emulator,
or why it's not starting. </p>
@@ -99,7 +99,7 @@ D/ActivityManager( 763): Stopping: HistoryRecord{409dbb20 com.android.home.AllAp
<a name="toptips" id="toptips"></a>
-<div class="sidebox">
+
<h2>Top Debugging Tips</h2>
<!--
<ul>
@@ -131,12 +131,12 @@ configurations on the emulator</a>.
<dt>Getting system state information from the emulator (dumpstate)<a name="dumpstate" id="dumpstate"></a> </dt>
<dd>You can access dumpstate information from the Dalvik Debug Monitor Service
-tool. See <a href="{@docRoot}reference/adb.html#dumpsys">dumpsys and
+tool. See <a href="{@docRoot}guide/developing/tools/adb.html#dumpsys">dumpsys and
dumpstate</a> on the adb topic page.</dd>
<dt>Getting application state information from the emulator (dumpsys)<a name="dumpsys" id="dumpsys"></a></dt>
<dd>You can access dumpsys information from the Dalvik Debug Monitor Service
-tool. See <a href="{@docRoot}reference/adb.html#dumpsys">dumpsys and
+tool. See <a href="{@docRoot}guide/developing/tools/adb.html#dumpsys">dumpsys and
dumpstate</a> on the adb topic page.</dd>
<dt>Getting wireless connectivity information <a name="radioinfo" id="radioinfo"></a></dt>
@@ -147,7 +147,7 @@ radio state&quot;.</dd>
<dt>Logging Trace Data<a name="loggingdata" id="loggingdata"></a></dt>
<dd>You can log method calls and other tracing data in an activity by calling
android.os.Debug.startMethodTracing(). See <a
-href="{@docRoot}reference/traceview.html">Running the Traceview Debugging
+href="{@docRoot}guide/developing/tools/traceview.html">Running the Traceview Debugging
Program</a> for details. </dd>
<dt>Logging Radio Data<a name="logradio" id="logradio"></a></dt>
@@ -163,7 +163,7 @@ logcat -b radio
<dt>Running adb<a name="adb" id="adb"></a></dt>
<dd>Android ships with a tool called adb that provides various capabilities, including
moving and syncing files to the emulator, forwarding ports, and running a UNIX
-shell on the emulator. See <a href="{@docRoot}reference/adb.html">Using adb</a> for details.</dd>
+shell on the emulator. See <a href="{@docRoot}guide/developing/tools/adb.html">Using adb</a> for details.</dd>
<dt>Getting screen captures from the emulator<a name="screencaps" id="screencaps"></a></dt>
<dd> Dalvik Debug Monitor Server (DDMS) can capture screenshots from the emulator.</dd>
@@ -176,5 +176,20 @@ shell on the emulator. See <a href="{@docRoot}reference/adb.html">Using adb</a>
<dd>Android provides debug helper classes such as {@link android.util.Log
util.Log} and {@link android.os.Debug} for your convenience. </dd>
</dl>
-<a name="building"></a>
-</div> \ No newline at end of file
+
+<h2 id="ide-debug-port">Configuring your IDE to attach to the debugging port</h2>
+
+<p>DDMS will assign 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 &quot;Wait for debugger&quot; 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 &quot;Wait for debugger&quot;
+ 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/develop-and-debug.jd b/docs/html/guide/developing/develop-and-debug.jd
deleted file mode 100644
index 6a337a9..0000000
--- a/docs/html/guide/developing/develop-and-debug.jd
+++ /dev/null
@@ -1,675 +0,0 @@
-page.title=Develop and Debug
-@jd:body
-
-<p>This page offers an introduction to developing and debugging
-applications on Android. It teaches how to
-create, build, run and debug your Android code. Alternatively, you may like
-to begin with the
-<a href="/android/intro/hello-android.html">Hello Android tutorial</a>. </p>
-
-<h2>Contents</h2>
-
-<ol class="toc">
-<li><a href="#developingwitheclipse">Developing Android Applications on Eclipse</a></li>
-<li><a href="#otherides">Developing Android Applications with Other IDEs and Tools</a></li>
-<li><a href="#signing">Signing Your Applications</a></li>
-<li><a href="#apidemos">Using the ApiDemos Sample Applications</a></li>
-<li><a href="#debugging">Debugging</a></li>
-<li><a href="#additionaldebugging">Debug and Test Settings on the Device</a></li>
-<li><a href="#toptips">Top Debugging Tips</a></li>
-<li><a href="#building">Building and Installing an Android Application</a></li>
-<li><a href="#uninstalling">Removing an Android Application</a></li>
-<li><a href="#tips">Eclipse Tips</a></li>
-</ol>
-
-
-
-<a name="developingwitheclipse"></a>
-
-<h2 style="clear: right;">
-Developing Android Applications on Eclipse</h2>
-
-<p>To begin developing Android applications in the Eclipse IDE, you first create an Android
-project and then set up a launch configuration. After that, you can write, run, and debug
-your application. </p>
-
-<p>The sections below provide instructions assuming that you have installed the ADT plugin
-in your Eclipse environment. If you haven't installed the ADT plugin, you should do that
-before using the instructions below. See the <a href="{@docRoot}intro/installing.html#installingplugin">Installing the
-Eclipse Plugin (ADT)</a> for more information.
-
-<a name="creatingaproject" id="creatingaproject"></a>
-
-<h3>Creating an Android Project</h3>
-
-<p>The ADT plugin provides a New Project Wizard that you can use to quickly create an
-Eclipse project for new or existing code. To create the project, follow these steps:</p>
-
-<a name="existingcode"></a>
-
-<ol>
- <li>Select <strong>File</strong> &gt; <strong>New</strong> &gt; <strong>Project</strong></li>
- <li>Select <strong>Android</strong> &gt; <strong>Android Project</strong>, and press <strong>Next</strong></li>
- <li>Select the contents for the project:
- <ul>
- <li>Select <strong>Create new project in workspace</strong> to start a project for new code.
- <p>Enter the project name, the base package name, the name of a single Activity class to create as a stub .java file, and a name to use for your application.</p></li>
- <li>Select <strong>Create project from existing source</strong> to start a project from existing code. Use this option if you want to build and run any of the sample applications included with the SDK. The sample applications are located in the samples/ directory in the SDK.
- <p>Browse to the directory containing the existing source code and click OK. If the directory contains a valid Android manifest file, the ADT plugin fills in the package, activity, and application names for you.</p>
- </li>
- </ul>
- </li>
- <li>Press <strong>Finish</strong>.</li>
-</ol>
-
-<p>The ADT plugin creates the these folders and
- files for you as appropriate for the type of project:</p>
-
- <ul>
- <li>src/&nbsp;&nbsp;&nbsp;A
- folder that includes your stub .java Activity file.</li>
- <li>res/&nbsp;&nbsp;&nbsp;A folder for your
- resources.</li>
- <li>AndroidManifest.xml&nbsp;&nbsp;&nbsp;The
- manifest for your project. </li>
- </ul>
-
-</ol>
-
-<a name="launchconfig" id="launchconfig"></a>
-
-<h3>Creating a Launch Configuration </h3>
-
-<p>Before you can run and debug your application in Eclipse, you must create a launch configuration for it. A launch configuration specifies the project to launch, the Activity to start, the emulator options to use, and so on. </p>
-
-<p>To create a launch configuration for the application, follow these steps as appropriate for your Eclipse version:</p>
-
-<ol>
-
- <li>Open the launch configuration manager.
- <ul>
- <li>In Eclipse 3.3 (Europa), select <strong>Run </strong>&gt;
- <strong>Open Run Dialog... </strong>or <strong>Run </strong>&gt;
- <strong>Open Debug Dialog... </strong>as appropriate.
- </li>
- <li>In Eclipse 3.4 (Ganymede), select <strong>Run </strong>&gt;
- <strong>Run Configurations... </strong>or <strong>Run </strong>&gt;
- <strong>Debug Configurations... </strong>as appropriate.
- </li>
- </ul>
- </li>
- <li>In the project type list on the left, locate the <strong> Android Application</strong> item and double-click it (or right-click &gt; <strong>New</strong>), to create a new launch configuration.</li>
- <li>Enter a name for your configuration.</li>
- <li>On the Android tab, browse for the project and Activity to start.</li>
- <li>On the Target tab, set the desired screen and network properties, as well as any other <a href="{@docRoot}reference/emulator.html#startup-options">emulator startup options</a>.</li>
- <li>You can set additional options on the Common tab as desired.</li>
- <li>Press <strong>Apply</strong> to save the launch configuration, or press <strong>Run</strong> or <strong>Debug</strong> (as appropriate).</li>
-
-</ol>
-
-<a name="installingrunningdebugging" id="installingrunningdebugging"></a>
-
-<h3>Running and Debugging an Application</h3>
-
-<p>Once you've set up the project and launch configuration for your application, you can run or debug it as described below.</p>
-
-From the Eclipse main menu, select <strong>Run</strong> &gt; <strong>Run</strong> or <strong>Run</strong> &gt; <strong>Debug</strong> as appropriate, to run or debug the active launch configuration. </li>
-
-<p>Note that the active launch configuration is the one most recently selected in the Run configuration manager. It does not necessarily correspond to the application that is selected in the Eclipse Navigation pane (if any).</p>
-
-<p>To set or change the active launch configuration, use the launch configuration manager. See <a href="#launchconfig">Creating a Launch Configuration</a> for information about how to access the launch configuration manager.</strong>.</p>
-
-<p>Running or debugging the application triggers these actions:</p>
-<ul><li>Starts the emulator, if it is not already running. </li>
- <li>Compiles the project, if there have been changes since the last build, and installs the application on the emulator. </li>
- <li><strong>Run</strong> starts the application. </li>
- <li><strong>Debug</strong> starts the application in "Wait for debugger" mode, then opens the Debug perspective and attaches the Eclipse Java debugger to the application.</li>
-
- </ul>
-
-<a name="otherides" id="otherides"></a>
-<h2>Developing Android Applications with Other IDEs and Tools</h2>
-<p>The recommended way to develop an Android application is to use
- <a href="#developingwitheclipse">Eclipse
- with the ADT plugin</a>. This plugin provides editing, building,
- and debugging functionality integrated right into the IDE. </p>
-
-<p>However, if you'd rather develop your application in another IDE, such as IntelliJ,
- or use Eclipse without the ADT plugin, you can do that instead. The SDK
- provides the tools you need to set up, build, and debug your application.
- </p>
-
-
-<h3>Creating an Android Project </h3>
-
-<p>The Android SDK includes <code>activityCreator</code>, a program that generates a number of stub files for your project, as well as a build file. You can use the program to create an Android project for new code or from existing code, such as the sample applications included in the SDK. For Linux and Mac, the SDK provides <code>activitycreator</code> and for Windows, <code>activityCreator.bat</code>, a batch script. Regardless of platform, you can use <code>activitycreator</code> in the same way. </p>
-
-<p>To run <code>activityCreator</code> and create an Android project, follow these steps:</p>
-
-<ol>
- <li> In the command line, change to the <code>tools/</code> directory of the SDK and create a new directory for your project files. If you are creating a project from existing code, change to the root folder of your application instead. </li>
-
- <li><p>Run <code>activityCreator</code>. In the command, you must specify a fully-qualified class name as an argument. If you are creating a project for new code, the class represents the name of a stub class that the script will create. If you are creating a project from existing code, you must specify the name of one Activity class in the package. Command options for the script include:
-<ul>
- <li><code>--out &lt;folder&gt;</code> which sets the output directory. By default, the output directory is the current directory. If you created a new directory for your project files, use this option to point to it. </li>
- <li><code>--ide intellij</code>, which generates IntelliJ IDEA project files in the newly created project</li>
-</ul>
-</li>
-</ol>
-
-<p>Here's an example:</p>
-<pre>
-~/android_linux_sdk/tools $ ./activityCreator.py --out myproject your.package.name.ActivityName
-package: your.package.name
-out_dir: myproject
-activity_name: ActivityName
-~/android_linux_sdk/tools $ </pre>
-
-<p>The <code>activityCreator</code> script generates the following files and directories (but will not overwrite existing ones):</p>
-
-<ul>
- <li><code>AndroidManifest.xml</code> The application manifest file, synced to the specified Activity class for the project.</li>
- <li><code>build.xml</code> An <code>Ant</code> file that you can use to build/package the application.</li>
- <li><code>src<em>/your/package/name/ActivityName</em>.java</code>&nbsp;The Activity class you specified on input.</li>
- <li><code><em>your_activity</em>.iml, <em>your_activity</em>.ipr,
- <em>your_activity</em>.iws&nbsp;&nbsp;&nbsp;</code> [<em>only
- with the <code>-ide intelliJ</code> flag</em>] intelliJ project
- files. </li>
- <li><code>res/</code> &nbsp;&nbsp;A directory to hold resources. </li>
- <li><code>src/</code> &nbsp;&nbsp;&nbsp;The source directory.
- <li><code>bin/</code> &nbsp;&nbsp;&nbsp;The output directory for the build script.</li>
-</ul>
-
-<p>You can now move your folder wherever you want for development, but keep in mind
- that you'll have to use the <a href="{@docRoot}reference/adb.html">adb</a> program in the <code>tools/</code> folder to
- send files to the emulator, so you'll need access between your solution and
- the <code>tools/</code> folder. </p>
-
-<p>Also, you should refrain from moving the
- location of the SDK directory, since this will break the build scripts (they
- will need to be manually updated to reflect the new SDK location before they will
- work again).</p>
-
-<a name="buildingwithant"></a>
-
-<h3>Building an Android Application</h3>
-<p>Use the Ant <code>build.xml</code> file generated by
- <code>activityCreator</code> to build your application.</p>
-<ol>
- <li>If you don't have it, you can obtain Ant from the
- <a href="http://ant.apache.org/">Apache Ant home page</a>. Install it and make
- sure it is on your executable path. </li>
- <li>Before calling Ant, you need to declare the JAVA_HOME environment variable to specify the path to where the JDK is installed.
- <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: <code>set JAVA_HOME=c:\Prora~1\Java\<jdkdir></code>. The easiest solution, however, is to install JDK in a non-space directory, for example: <code>c:\java\jdk1.6.0_02</code>. </p>
- </li>
-
-
- <li>If you have not done so already, follow the instructions for Creating a
- New Project above to set up the project.</li>
- <li>You can now run the Ant build file by simply typing ant in the same folder
- as the build.xml file for your project. Each time you change
- a source file or resource, you should run ant again and it will package up the
- latest version of the application for you to deploy.</li>
-</ol>
-
-<h3>Running an Android Application</h3>
-<p>To run a compiled
- application, you will upload the .apk file to the <code>/data/app/ </code>directory
- in the emulator using the <a href="{@docRoot}reference/adb.html">adb</a> tool as described here:</p>
-<ol>
- <li>Start the emulator (run <code><em>&lt;your_sdk_dir&gt;</em>/tools/emulator</code> from the command line)</li>
- <li>On the emulator, navigate to the home screen (it is best not to have that
- application running when you reinstall it on the emulator; press the <strong>Home</strong> key
- to navigate away from that application).</li>
- <li>Run <code>adb install <em>myproject</em>/bin/&lt;<em>appname</em>&gt;.apk</code> to upload
- the executable. So, for example, to install the Lunar Lander sample, navigate
- in the command line to <code><em>&lt;your_sdk_dir&gt;</em>/sample/LunarLander</code> and type <code>../../tools/adb&nbsp;install&nbsp;bin/LunarLander.apk</code></li>
- <li>In the emulator, open the list of available applications, and scroll down to
- select and start your application. </li>
-</ol>
-<p class="note"><strong>Note:</strong> When you install an Activity for the
- first time, you might have to restart the emulator before it shows up in the
- application launcher, or other applications can call it. This is because
- the package manager usually only examines manifests completely on emulator
- startup.</p>
-
-<h3>Attaching a Debugger to Your Application</h3>
-<p>This section describes how to display debug information on the screen (such
- as CPU usage), as well as how to hook up your IDE to debug running applications
- on the emulator. </p>
-
-<p>Attaching a debugger is automated using the Eclipse plugin,
- but you can configure other IDEs to listen on a debugging port to receive debugging
- information.</p>
-<ol>
- <li><strong>Start the <a href="{@docRoot}reference/ddms.html">Dalvik Debug Monitor Server (DDMS)
- tool </a>, </strong> which
- acts as a port forwarding service between your IDE and the emulator.</li>
- <li><strong>Set
- optional debugging configurations on
- your emulator</strong>, such as blocking application startup for an activity
- until a debugger is attached. Note that many of these debugging options
- can be used without DDMS, such as displaying CPU usage or screen refresh
- rate on the emulator.</li>
- <li><strong>Configure your IDE to attach to port 8700 for debugging.</strong> We
- include information on <a href="#eclipse">how to set up Eclipse to debug
- your project</a>. </li>
-
-<a name="eclipse" id="eclipse"></a>
-
-</ol>
-<h3>Configuring your IDE to attach to the debugging port</h3>
-
-<p>DDMS will assign 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 &quot;Wait for debugger&quot; 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 &quot;Wait for debugger&quot;
- 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>
-
-<a name="signing" id="signing"></a>
-
-<h2>Signing Your Applications</h2>
-
-<p>The Android system requires that all installed applications are digitally signed &mdash;
-the 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 set up signing for your application before you will be able to
-run or debug it on an emulator or device.</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
-that is not signed.</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 &mdash; Keytool and Jarsigner &mdash; to generate keys and
-sign your application .apk files.</li>
-</ul>
-
-<p>The Android SDK tools assist you in signing your applications when debugging. Both the ADT Plugin
-for Eclipse and the Ant build tool offer two signing modes &mdash; debug mode and release mode.
-
-<ul>
- <li>In debug mode, the build tools use the Keytool utility, included in the JDK, to create
-a keystore and key with a known alias and password. At each compilation, the tools then use
-the debug key to sign the application .apk file. Because the password is known, the tools
-don't need to prompt you for the keystore/key password each time you compile.</li>
-
- <li>When your application is ready for release, you compile it in release signing mode.
-In release mode, the tools compile your .apk without signiing it. You must then use Keytool
-to generate your own keystore/key and then use the Jarsigner tool, also included in the JDK,
-to sign the .apk.</li>
-</ul>
-
-<h3>Basic Setup for Signing</h3>
-
-<p>To support the generation of a keystore and debug key, you should first make sure that
-Keytool is available to the SDK build
-tools. In most cases, you can tell the SDK build tools how to find Keytool by making sure
-that your JAVA_HOME environment variable is set and that it references a suitable JDK.
-Alternatively, you can add the JDK version of Keytool to your PATH 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 PATH, it might be pointing to a symlink at
-/usr/bin/keytool. In this case, check the symlink target to make sure that it points
-to the Keytool in the JDK.</p>
-
-<h3>Signing in Eclipse/ADT</h3>
-
-<p>If you are developing in Eclipse and have set up Keytool as described above, signing
-in debug mode is enabled by default. When you run or debug your app, ADT signs the .apk
-for you and installs it on the emulator. No specific action on your part is needed,
-provided ADT has access to Keytool.</p>
-
-<p>To compile your application in release mode, right-click the project in the Package
-pane and select Android Tools > Export Application Package. Alternatively, you can follow the
-"Exporting the unsigned .apk" link in the Manifest Editor overview page. After you have saved
-the exported .apk, you need to use Jarsigner to sign the .apk with your own key before
-distribution. If you don't have a key, you can use Keystore to create a keystore and key with
-all the appropriate fields. If you already have a key, such as a corporate key, you can use
-that to sign the .apk.</p>
-
-<h3>Signing in Ant</h3>
-
-<p>If you use Ant to build your .apk files, debug signing mode
-is enabled by default, assuming that you are using a build.xml file generated by the
-activitycreator tool included in the latest SDK. When you run Ant against build.xml to
-compile your app, the build script generates a keystore/key and signs the .apk for you.
-No specific action on your part is needed.</p>
-
-<p>To compile your application in release mode, all you need to do is specify a build target
-"release" in the Ant command. For example, if you are running Ant from the directory containing
-your build.xml file, the command would look like this:</p>
-
-<pre>ant release</pre>
-
-<p>The build script compiles the application .apk without signing it. After you have compiled
-the.apk, you need to use Jarsigner to sign the .apk with your own key before
-distribution. If you don't have a key, you can use Keystore to create a keystore and key
-with all the appropriate fields. If you already have a key, such as a corporate key, you
-can use that to sign the .apk.</p>
-
-<h3>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 1 year 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. On Linux/Mac OSX,
-the file is stored in <code>~/.android</code>. OOn Windows XP, the file is stored in <code>
-C:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Android</code>.
-On Windows Vista, the file is stored in <code>
-C:\Users\&lt;user&gt;\AppData\Local\Android</code>.</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}kb/troubleshooting.html#signingcalendar">
-I&nbsp;can't&nbsp;compile my app because the build tools generated an expired debug
-certificate</a>. </p>
-
-<h2 id="apidemos">Using the ApiDemos Sample Applications</h2>
-
-<p>The Android SDK includes a set of sample applications that demonstrate much of
-the functionality and API usage needed for your applications. The ApiDemos package is
-preinstalled on the emulator, so you can access it by starting an emulator and sliding
-open the home screen's application drawer. </p>
-
-<p>You can find the source code corresponding to the ApiDemos apps in <code>&lt;SDK&gt;
-/samples/ApiDemos</code> and look at it to learn more about how it is implemented.</p>
-
-<p>If you want, you can load the ApiDemos sample applications as source projects and modify
-them, then run them in the emulator. However, to do so, you need to uninstall the preinstalled
-version of ApiDemos first. If you try to run or modify ApiDemos from your development environment
-without removing the preinstalled version first, you will get an install error.</p>
-
-<p>For information about how to uninstall and then reinstall ApiDemos so that you can work with
-them in your development environment, see the troubleshooting topic
-<a href="{@docRoot}kb/troubleshooting.html#apidemosreinstall">I&nbsp;can't install ApiDemos
-apps in my IDE because of a signing error</a>.</p>
-
-<a name="debugging" id="debugging"></a>
-
-<h2>Debugging</h2>
-
-<p>Android has a fairly extensive set of tools to help you debug your programs: </p>
-<ul>
- <li><a href="{@docRoot}reference/ddms.html"><strong>DDMS</strong></a> - A graphical program that
- supports port forwarding (so you can set up breakpoints in your code in your
- IDE), screen captures on the emulator, thread and stack information,
- and many other features. You can also run logcat to retrieve your Log messages.
- See the linked topic for more information. </li>
- <li><strong><a href="{@docRoot}reference/ddms.html#logcat">logcat</a></strong> - Dumps a log of system
- messages. The messages include a stack trace when the emulator throws an error,
- as well as Log messages. To run logcat, see the linked topic.
-
- <pre>...
-I/MemoryDealer( 763): MemoryDealer (this=0x54bda0): Creating 2621440 bytes heap at 0x438db000
-<span style="background-color:#CCCCCC; border-bottom:medium">I/Logger( 1858): getView() requesting item number 0
-I/Logger( 1858): getView() requesting item number 1
-I/Logger( 1858): getView() requesting item number 2</span>
-D/ActivityManager( 763): Stopping: HistoryRecord{409dbb20 com.android.home.AllApps}
-...</pre>
-
- </li>
- <li><p><strong>{@link android.util.Log Android Log}</strong>- A logging
- class to print out messages to a log file on the emulator. You can read messages
- in real time if you run logcat on DDMS (covered next). Add a few logging
- method calls to your code.</p>
- <p>To use the <code>Log</code> class, you just call <code>Log.v()</code>
- (verbose), <code>Log.d()</code> (debug), <code>Log.i()</code> (information),
- <code>Log.w()</code> (warning) or <code>Log.e</code> (error) depending
- on the importance you wish to assign the log message.</p>
- <code>Log.i(&quot;MyActivity&quot;, &quot;MyClass.getView()
- &mdash; Requesting item number &quot; + position)</code>
- <p>You can use logcat to read these messages</p></li>
- <li><strong><a href="{@docRoot}reference/traceview.html">Traceview</a> </strong>- Android can save
- a log of method calls and times to a logging file that you can view in a
- graphical reader called Traceview. See the linked topic for more information. </li>
-</ul>
-<ul>
- <li><a href="#developingwitheclipse"><strong>Eclipse plugin</strong></a> - The Eclipse
- Android plugin incorporates a number of these tools (ADB, DDMS, logcat output,
- and other functionality). See the linked topic for more information. </li>
- <li><strong>Debug and Test Device Settings</strong> - Android exposes several settings
- that expose useful information such as CPU usage and frame rate. See <a href="#additionaldebugging">Debug
- and Test Settings on the Emulator</a> below. </li>
-</ul>
-<p>Also, see the <a href="{@docRoot}kb/troubleshooting.html">Troubleshooting</a> section
- of the doc to figure out why your application isn't appearing on the emulator,
- or why it's not starting. </p>
-
-<a name="additionaldebugging" id="additionaldebugging"></a>
-
-<h2>Debug and Test Settings on the Device</h2>
-
-<p>Android lets you set a number of settings that will make it easier to test
- and debug your applications. To get to the development settings page on the emulator,
- go to <strong>Dev Tools </strong>&gt; <strong>Development Settings</strong>.
- This will open the development settings page with the following options (among
- others):</p>
-<ul>
- <li><strong>Debug app</strong>&nbsp;&nbsp;&nbsp;Selects the application that
- will be debugged. 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>
- </li>
- <li><strong>Wait for debugger </strong> &nbsp;&nbsp;
- Blocks the selected application from loading until a debugger attaches. This
- way you can set a breakpoint in 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. </li>
- <li><strong>Immediately destroy activities</strong>&nbsp;&nbsp;&nbsp;Tells the
- system to destroy an activity as soon as it is stopped (as if Android had to
- reclaim memory).&nbsp; 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.</li>
- <li><strong>Show screen updates</strong>&nbsp;&nbsp;&nbsp;
- Flashes a momentary pink rectangle on any screen sections that are being
- redrawn. This is very useful for discovering unnecessary screen drawing. </li>
- <li><strong>Show CPU usage</strong>&nbsp;&nbsp;&nbsp;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. <em>Note: You cannot turn this feature off
- once it is on, without restarting the emulator.</em> </li>
- <li><strong>Show background</strong>&nbsp;&nbsp;&nbsp;Displays a background pattern
- when no activity screens are visible. This typically does not happen, but
- can happen during debugging. </li>
-</ul>
-<p>These settings will be remembered across emulator restarts. </p>
-
-<a name="toptips" id="toptips"></a>
-
-<h2>Top Debugging Tips</h2>
-<!--
-<ul>
- <li><a href="#stackdump">Quick stack dump</a></li>
- <li><a href="#displayinfo">Displaying useful info on the emulator screen </a></li>
- <li><a href="#dumpstate">Getting system state information from the emulator (dumpstate)</a></li>
- <li><a href="#dumpsys">Getting application state information from the emulator (dumpsys)</a></li>
- <li><a href="#radioinfo">Getting wireless connectivity information</a></li>
- <li><a href="#loggingdata">Logging Trace Data</a></li>
- <li><a href="#logradio">Logging Radio Data </a></li>
- <li><a href="#adb">Running adb</a></li>
- <li><a href="#screencaps">Getting screen captures from the emulator</a></li>
- <li><a href="#debughelpers">Using debug helper classes</a></li>
-</ul>
--->
-<dl>
-<dt>Quick stack dump <a name="stackdump" id="stackdump"></a></dt>
-<dd>To obtain a stack dump from emulator, you can log
-in with <code>adb shell</code>, use &quot;ps&quot; to find the process you
-want, and then &quot;kill -3 &quot;. The stack trace appears in the log file.
-</dd>
-
-<dt>Displaying useful info on the emulator screen<a name="displayinfo" id="displayinfo"></a></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="#additionaldebugging">Setting debug and test
-configurations on the emulator</a>.
-</dd>
-
-<dt>Getting system state information from the emulator (dumpstate)<a name="dumpstate" id="dumpstate"></a> </dt>
-<dd>You can access dumpstate information from the Dalvik Debug Monitor Service
-tool. See <a href="{@docRoot}reference/adb.html#dumpsys">dumpsys and
-dumpstate</a> on the adb topic page.</dd>
-
-<dt>Getting application state information from the emulator (dumpsys)<a name="dumpsys" id="dumpsys"></a></dt>
-<dd>You can access dumpsys information from the Dalvik Debug Monitor Service
-tool. See <a href="{@docRoot}reference/adb.html#dumpsys">dumpsys and
-dumpstate</a> on the adb topic page.</dd>
-
-<dt>Getting wireless connectivity information <a name="radioinfo" id="radioinfo"></a></dt>
-<dd>You can get information about wireless connectivity using the Dalvik Debug
-Monitor Service tool. From the <strong>Device</strong> menu, select &quot;Dump
-radio state&quot;.</dd>
-
-<dt>Logging Trace Data<a name="loggingdata" id="loggingdata"></a></dt>
-<dd>You can log method calls and other tracing data in an activity by calling
-android.os.Debug.startMethodTracing(). See <a
-href="{@docRoot}reference/traceview.html">Running the Traceview Debugging
-Program</a> for details. </dd>
-
-<dt>Logging Radio Data<a name="logradio" id="logradio"></a></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>
-adb shell
-logcat -b radio
-</pre>
-</dd>
-
-<dt>Running adb<a name="adb" id="adb"></a></dt>
-<dd>Android ships with a tool called adb that provides various capabilities, including
-moving and syncing files to the emulator, forwarding ports, and running a UNIX
-shell on the emulator. See <a href="{@docRoot}reference/adb.html">Using adb</a> for details.</dd>
-
-<dt>Getting screen captures from the emulator<a name="screencaps" id="screencaps"></a></dt>
-<dd> Dalvik Debug Monitor Server (DDMS) can capture screenshots from the emulator.</dd>
-
-
-<a name="debughelpers"></a>
-
-<dt>Using debugging helper classes</dt>
-
-<dd>Android provides debug helper classes such as {@link android.util.Log
- util.Log} and {@link android.os.Debug} for your convenience. </dd>
-</dl>
-<a name="building"></a>
-
-<h2>Building and Installing an Android Application</h2>
-<p>Android requires custom build tools to be able to properly build the resource
- files and other parts of an Android application. Because of this, you must have
- a specialized build environment for your application. </p>
-<p>Custom
- Android compilation steps include compiling the XML and other resource files, and creating
- the proper output format. A compiled Android application is an .apk file, which
- is a compressed file containing <a href="{@docRoot}reference/glossary.html">.dex</a> files, resource files, raw data files, and
- other files. You can create a properly structured Android project either from
-scratch, or from existing source files. </p>
-<p>Android does not currently support development of third party applications in native code (C/C++).</p>
-<p><strong>The recommended way</strong> to develop an Android
- application is to <a href="#developingwitheclipse">use Eclipse with the Android plugin</a>,
- which provides support for building, running, and debugging Android applications. </p>
-<p><strong>If you have another IDE</strong>, <a href="#otherides">Android
- provides tools for other IDEs</a> to build and debug Android applications,
- but they are not as integrated. </p>
-
-<a name="uninstalling" id="uninstalling"></a>
-
- <h2>Removing an Android Application</h2>
-
- <p>To remove an application that you have installed on the emulator, you will
- need to <a href="{@docRoot}reference/adb.html">run adb</a> and delete the .apk
- file you sent to the emulator when you installed it. Use <code>adb
- shell</code> to drop into a shell on the device as described in the linked
- topic, navigate to <code>data/app/</code>, and then remove the file using
- <code>rm <em>your_app</em>.apk</code>. </p>
-
-<a name="tips" id="tips"></a>
-
- <h2>Eclipse Tips </h2>
- <h3>Executing arbitrary Java expressions in Eclipse<a name="arbitraryexpressions" id="arbitraryexpressions"></a></h3>
- <p>You can execute arbitrary code when paused at a breakpoint in Eclipse. For example,
- when in a function with a String argument called &quot;zip&quot;, you can get
- information about packages and call class methods. You can also invoke arbitrary
- static methods: for example, entering <code>android.os.Debug.startMethodTracing()</code> will
- start dmTrace. </p>
- <p>Open a code execution window, select <strong>Window</strong>&gt;<strong>Show
- View</strong>&gt;<strong>Display</strong> from the main menu to open the
- Display window, a simple text editor. Type your expression, highlight the
- text, and click the 'J' icon (or CTRL + SHIFT + D) to run your
- code. The code runs in the context of the selected thread, which must be
- stopped at a breakpoint or single-step point. (If you suspend the thread
- manually, you have to single-step once; this doesn't work if the thread is
- in Object.wait().)</p>
- <p>If you are currently paused on a breakpoint, you can simply highlight and execute
- a piece of source code by pressing CTRL + SHIFT + D. </p>
- <p>You can highlight a block of text within the same scope by pressing ALT +SHIFT
- + UP ARROW to select larger and larger enclosing blocks, or DOWN ARROW to select
- smaller blocks. </p>
- <p>Here are a few sample inputs and responses in Eclipse using the Display window.</p>
- <table width="100%" border="1">
- <tr>
- <th scope="col">Input</th>
- <th scope="col">Response</th>
- </tr>
- <tr>
- <td><code>zip</code></td>
- <td><code>(java.lang.String) /work/device/out/linux-x86-debug/android/app/android_sdk.zip</code></td>
- </tr>
- <tr>
- <td><code>zip.endsWith(&quot;.zip&quot;)</code></td>
- <td><code>(boolean) true</code></td>
- </tr>
- <tr>
- <td><code>zip.endsWith(&quot;.jar&quot;)</code></td>
- <td><code>(boolean) false</code></td>
- </tr>
- </table>
- <p>You can also execute arbitrary code when not debugging by using a scrapbook page.
- Search the Eclipse documentation for &quot;scrapbook&quot;.</p>
-
- <h3>Running DDMS Manually</h3>
-
- <p>Although the recommended way to debug is to use the ADT plugin, you can manually run DDMS and configure Eclipse to debug on port 8700. (<strong>Note: </strong>Be sure that you have first started <a href="{@docRoot}reference/ddms.html">DDMS</a>). </p>
-
-<h3>Adding JUnit test classes</h3>
-
-<p>In Eclipse/ADT, you can add JUnit test classes to your application. 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}kb/troubleshooting.html#addjunit">I can't run a Junit test class in Eclipse</a>.</p>
-
diff --git a/docs/html/guide/developing/draw9patch.jd b/docs/html/guide/developing/draw9patch.jd
deleted file mode 100644
index 25604f8..0000000
--- a/docs/html/guide/developing/draw9patch.jd
+++ /dev/null
@@ -1,61 +0,0 @@
-page.title=Draw 9-patch
-@jd:body
-
-<p>The Draw 9-patch tool allows you to easily create a
- {@link android.graphics.NinePatch} graphic using a WYSIWYG editor.</p>
-<p>To learn more about what a Nine-patch graphic is, and how they work, please read
-the section on Nine-patch in the
-<a href="{@docRoot}reference/available-resources.html#ninepatch">Available Resource
-Types</a> document.</p>
-
-<div class="sidebox" style="width:auto"><br/>
-<img src="/android/images/draw9patch-norm.png" alt="" height="300" width="341" />
-</div>
-
-<p>Here's a quick guide to create a Nine-patch graphic using the Draw 9-patch tool.
-You'll need the PNG image with which you'd like to create a NinePatch.</p>
-
-<ol>
- <li>From a terminal, launch the <code>draw9patch</code> application from your SDK
- <code>/tools</code> directory.
- </li>
- <li>Drag your PNG image into the Draw 9-patch window
- (or <strong>File</strong> > <strong>Open 9-patch...</strong> to locate the file).
- Your workspace will now open.
- <p>The left pane is your drawing area, in which you can edit the lines for the
- stretchable patches and content area. The right
- pane is the preview area, where you can preview your graphic when stretched.</p>
- </li>
- <li>Click within the 1-pixel perimeter to draw the lines that define the stretchable
- patches and (optional) content area. Right-click (or hold Shift and click, on Mac) to erase
- previously drawn lines.
- </li>
- <li>When done, select <strong>File</strong> > <strong>Save 9-patch...</strong>
- <p>Your image will be saved with the <code>.9.png</code> file name.</p>
- </li>
-</ol>
- <p class="note"><strong>Note:</strong> A normal PNG file (<code>*.png</code>) will be
- loaded with an empty one-pixel border added around the image, in which you can draw
- the stretchable patches and content area.
- A previously saved 9-patch file (<code>*.9.png</code>) will be loaded as-is,
- with no drawing area added, because it already exists.</p>
-
-<div class="sidebox" style="width:auto"><br/>
-<img src="/android/images/draw9patch-bad.png" alt="" height="300" width="341" />
-</div>
-
-<p>Optional controls include:</p>
-<ul>
- <li><strong>Zoom</strong>: Adjust the zoom level of the graphic in the drawing area.</li>
- <li><strong>Patch scale</strong>: Adjust the scale of the images in the preview area.</li>
- <li><strong>Show lock</strong>: Visualize the non-drawable area of the graphic on mouse-over.</li>
- <li><strong>Show patches</strong>: Preview the stretchable patches in the drawing area (pink is a
- stretchable patch).</li>
- <li><strong>Show content</strong>: Highlight the content area in the preview images
- (purple is the area in which content is allowed).</li>
- <li><strong>Show bad patches</strong>: Adds a red border around patch areas that may
- produce artifacts in the graphic when stretched. Visual coherence of your stretched
- image will be maintained if you eliminate all bad patches.</li>
-<ul>
-
-<p><strong><a href="/android/intro/tools.html">Back to Development Tools</a></strong></p> \ No newline at end of file
diff --git a/docs/html/guide/developing/eclipse-adt.jd b/docs/html/guide/developing/eclipse-adt.jd
index 94087bf..7177395 100644
--- a/docs/html/guide/developing/eclipse-adt.jd
+++ b/docs/html/guide/developing/eclipse-adt.jd
@@ -7,8 +7,7 @@ your application. </p>
<p>The sections below provide instructions assuming that you have installed the ADT plugin
in your Eclipse environment. If you haven't installed the ADT plugin, you should do that
-before using the instructions below. See the <a href="{@docRoot}intro/installing.html#installingplugin">Installing the
-Eclipse Plugin (ADT)</a> for more information.
+before using the instructions below. For complete information, see the installation documentation included in your SDK package. </p>
<a name="creatingaproject" id="creatingaproject"></a>
@@ -73,7 +72,7 @@ Eclipse project for new or existing code. To create the project, follow these st
<li>In the project type list on the left, locate the <strong> Android Application</strong> item and double-click it (or right-click &gt; <strong>New</strong>), to create a new launch configuration.</li>
<li>Enter a name for your configuration.</li>
<li>On the Android tab, browse for the project and Activity to start.</li>
- <li>On the Target tab, set the desired screen and network properties, as well as any other <a href="{@docRoot}reference/emulator.html#startup-options">emulator startup options</a>.</li>
+ <li>On the Target tab, set the desired screen and network properties, as well as any other <a href="{@docRoot}guide/developing/tools/emulator.html#startup-options">emulator startup options</a>.</li>
<li>You can set additional options on the Common tab as desired.</li>
<li>Press <strong>Apply</strong> to save the launch configuration, or press <strong>Run</strong> or <strong>Debug</strong> (as appropriate).</li>
@@ -143,4 +142,4 @@ From the Eclipse main menu, select <strong>Run</strong> &gt; <strong>Run</strong
<h3>Running DDMS Manually</h3>
- <p>Although the recommended way to debug is to use the ADT plugin, you can manually run DDMS and configure Eclipse to debug on port 8700. (<strong>Note: </strong>Be sure that you have first started <a href="{@docRoot}reference/ddms.html">DDMS</a>). </p>
+ <p>Although the recommended way to debug is to use the ADT plugin, you can manually run DDMS and configure Eclipse to debug on port 8700. (<strong>Note: </strong>Be sure that you have first started <a href="{@docRoot}guide/developing/tools/ddms.html">DDMS</a>). </p>
diff --git a/docs/html/guide/developing/emulator.jd b/docs/html/guide/developing/emulator.jd
deleted file mode 100755
index 0516fdd..0000000
--- a/docs/html/guide/developing/emulator.jd
+++ /dev/null
@@ -1,1724 +0,0 @@
-page.title=Android Emulator
-@jd:body
-
-<img src="{@docRoot}images/emulator-hvga-p.png" alt="Image of the Android Emulator" width="271" height="524" style="margin-left:0em;float:right;"/>
-
-<p>The Android SDK includes a mobile device emulator -- a virtual mobile device
-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 typical hardware and software features
-of a typical mobile device, except that it can not receive or 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
-Android applications running. </p>
-
-<p>To help you model and test your application, the emulator lets your application
-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 channel.</p>
-
-
-<h2 style="clear:right;">Contents</h2>
-
-<div class="g-section g-tpl-50-50">
-<div class="g-unit g-first">
-
-<dl>
-<dt><a href="#overview">Overview</a></dt>
-<dt><a href="#starting">Starting and Stopping the Emulator</a></dt>
-<dt><a href="#controlling">Controlling the Emulator</a></dt>
-<dt><a href="#startup-options">Emulator Startup Options</a></dt>
-<dt><a href="#diskimages">Working with Emulator Disk Images</a></dt>
- <dd><a href="#systemimages">System Images</a></dd>
- <dd><a href="#runtimeimages">Runtime Images: User Data and SD Card</a></dd>
- <dd><a href="#temporaryimages">Temporary Images</a></dd>
-<dt><a href="#emulatornetworking">Emulator Networking</a></dt>
- <dd><a href="#networkaddresses">Network Address Space</a></dd>
- <dd><a href="#networkinglimitations">Local Networking Limitations</a></dd>
- <dd><a href="#redirections">Using Network Redirections</a></dd>
- <dd><a href="#dns">Configuring the Emulator's DNS Settings</a></dd>
- <dd><a href="#proxy">Using the Emulator with a Proxy</a></dd>
- <dd><a href="#connecting">Interconnecting Emulator Instances</a></dd>
- <dd><a href="#calling">Sending a Voice Call or SMS to Another Emulator Instance</a></dd>
-</dl>
-</div>
-
-<div class="g-unit">
-<dl>
-<dt><a href="#console">Using the Emulator Console</a></dt>
- <dd><a href="#portredirection">Port Redirections</a></dd>
- <dd><a href="#geo">Geo Location Provider Emulation</a></dd>
- <dd><a href="#events">Sending Events</a></dd>
- <dd><a href="#power">Emulating Device Power Characteristics</a></dd>
- <dd><a href="#netstatus">Network Status</a></dd>
- <dd><a href="#netdelay">Network Delay Emulation</a></dd>
- <dd><a href="#netspeed">Network Speed Emulation</a></dd>
- <dd><a href="#telephony">Telephony Emulation</a></dd>
- <dd><a href="#sms">SMS Emulation</a></dd>
- <dd><a href="#vm">VM State</a></dd>
- <dd><a href="#window">Emulator Window</a></dd>
- <dd><a href="#terminating">Terminating an Emulator Instance</a></dd>
-<dt><a href="#skins">Using Emulator Skins</a></dt>
-<dt><a href="#multipleinstances">Running Multiple Instances of the Emulator</a></dt>
-<dt><a href="#apps">Installing Applications on the Emulator</a></dt>
-<dt><a href="#sdcard">SD Card Emulation</a></dt>
- <dd><a href="#creating">Creating a Disk Image</a></dd>
- <dd><a href="#copying">Copying Files to a Disk Image</a></dd>
- <dd><a href="#loading">Loading the Disk Image at Emulator Startup</a></dd>
-<dt><a href="#troubleshooting">Troubleshooting Emulator Problems</a></dt>
-<dt><a href="#limitations">Emulator Limitations</a></dt>
-</dl>
-</div>
-
-</div>
-
-<a name="overview"></a>
-
-<h2>Overview</h2>
-
-<p>The Android emulator is a QEMU-based application that provides a virtual ARM
-mobile device on which you can run your Android applications. It provides a full
-Android system stack, down to the kernel level, and includes a set of
-preinstalled applications (such as the dialer) that you can access from your
-applications. It provides a skinnable mobile device UI, customizable key
-mappings, and a variety of commands and options for controlling the behaviors of
-the emulated environment. </p>
-
-<p>The Android system image distributed in the SDK contains ARM machine code for
-the Android Linux kernel, the native libraries, the Dalvik VM, and the various
-Android package files (such as for for the Android framework and preinstalled
-applications). The emulator's QEMU layers provide dynamic binary translation of
-the ARM machine code to the OS and processor architecture of your development
-machine. </p>
-
-<p>Adding custom capabilities to the underlying QEMU services, 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>
-</ul>
-
-<p>The sections below provide more information about the emulator and how to use
-it for developing Android applications.</p>
-
-<a name="starting"></a>
-
-<h2>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 use it as part of your Eclipse
-development environment. In either case, you can specify the startup options
-described in this document to control the emulator.
- </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 redirections that allow 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, change to the
-<code>tools/</code> folder of the SDK and enter <code>emulator</code> or
-<code>./emulator</code>. This initializes the Android system and you will see
-the emulator window appear on your screen. </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>
-
-<a name="controlling"></a>
-
-<h2>Controlling the Emulator</h2>
-
-<p>You can use emulator <a href="#startup-options">startup options</a> and <a
-href="#console">console commands</a> to control the behaviors and
-characteristics of the emulated environment itself.
-</p>
-
-<p>When the emulator is running, you can interact with the emulated mobile
-device just as you would an actual mobile device, except that you use your mouse
-pointer to &quot;touch&quot; the touchscreen and your keyboard keys to
-&quot;press&quot; the simulated device keys. </p>
-
-<p>The table below summarizes the mappings between the emulator keys and and
-the keys of your keyboard. </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, F11</td>
- </tr>
- <tr>
- <td>Switch to next layout orientation (for example, portrait, landscape)</td>
- <td>KEYPAD_9, 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>Ctrl-T</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>
-
-<p>Note that, to use keypad keys, you must first disable NumLock on your development computer. </p>
-
-<a name="startup-options"></a>
-
-<h2> Emulator Startup Options</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 usage for launching the emulator with options: </p>
-
-<pre>emulator [-&lt;option&gt; [&lt;value&gt;]] ... [-&lt;qemu args&gt;]</pre>
-
-<p>The table below summarizes the available options.</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 rowspan="8">Help</td>
- <td><code>-help</code></td>
- <td>Print a list of all emulator options.</td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>-help-all</code></td>
- <td>Print help for all startup options.</td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>-help-&lt;option&gt;</code></td>
- <td>Print help for a specific startup option.</td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>-help-debug-tags</code></td>
- <td>Print a list of all tags for <code>-debug &lt;tags&gt;</code>.</td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>-help-disk-images</code></td>
- <td>Print help for using emulator disk images.</td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>-help-environment</code></td>
- <td>Print help for emulator environment variables.</td>
- <td>&nbsp;</td>
-</tr><tr>
- <td><code>-help-keys</code></td>
- <td>Print the current mapping of keys.</td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>-help-keyset-file</code></td>
- <td>Print help for defining a custom key mappings file.</td>
- <td>&nbsp;</td>
-</tr>
-
-<tr>
- <td rowspan="10">Disk Images</td>
- <td><code>-cache&nbsp;&lt;filepath&gt;</code></td>
- <td>Use &lt;filepath&gt; as the working cache partition image. </td>
- <td>Optionally, you can specify a path relative 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&nbsp;&lt;filepath&gt;</code></td>
- <td>Use &lt;filepath&gt; 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 &quot;userdata-qemu.img&quot;
- in the directory specified in &lt;datadir&gt;. ~/.android (on Linux/Mac) or
- C:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Android (on Windows).
- <p> If you use <code>-data &lt;filepath&gt;</code> but the file does not exist, the emulator creates
- a file at that location using the specified name. </p>
- <p>See <a href="#multipleinstances">Running Multiple Emulator Instances</a> for information about how
- to use <code>-data</code> to let multiple emulator instances preserve their user data across sessions.</p>
- <p>For more information on disk images, use <code>-help-disk-images</code>.</p>
-</td></tr>
-<!--
-<tr>
- <td><code>-datadir &lt;dir&gt;</code></td>
- <td>Search for the user-data disk image specified in <code>-data</code> in &lt;dir&gt;</td>
- <td><code>&lt;dir&gt;</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
- directory ~/.android (on Linux/Mac) or C:\Documents and Settings\&lt;user&gt;\Local Settings\Application
- Data\Android (on Windows). </p><p>For more information on disk images, use <code>-help-disk-images</code>.</p>
-</td></tr>
--->
-<tr>
- <td><code>-image&nbsp;&lt;filepath&gt;</code></td>
- <td>Use &lt;filepath&gt; as the system image.</td>
- <td>Optionally, you can specify a path relative to the current working directory.
- Default is &lt;system&gt;/system.img.</td>
-</tr>
-<tr>
- <td><code>-initdata&nbsp;&lt;filepath&gt;</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>&lt;system&gt;/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>-kernel&nbsp;&lt;filepath&gt;</code></td>
- <td>Use &lt;filepath&gt; as the emulated kernel.</td>
- <td>Optionally, you can specify a path relative to the current working directory. </td>
-</tr>
-<tr>
- <td><code>-nocache</code></td>
- <td>Start the emulator without a cache partition.</td>
- <td>See also <code>-cache &lt;file&gt;</code>.</td>
-</tr>
-<tr>
- <td><code>-ramdisk&nbsp;&lt;filepath&gt;</code></td>
- <td>Use &lt;filepath&gt; as the ramdisk image.</td>
- <td>Default value is <code>&lt;system&gt;/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&nbsp;&lt;filepath&gt;</code></td>
- <td>Use &lt;file&gt; as the SD card image.</td>
- <td>Default value is <code>&lt;system&gt;/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&nbsp;&lt;dirpath&gt;</code></td>
- <td>Search for system, ramdisk and user data images in &lt;dir&gt;.</td>
- <td><code>&lt;dir&gt;</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 &lt;tags&gt;</code></td>
- <td>Enable/disable debug messages for the specified debug tags.</td>
- <td><code>&lt;tags&gt;</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-&lt;tag&gt;</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>&lt;tag&gt;</code>. </td>
-</tr>
-<tr>
- <td><code>-debug-no-&lt;tag&gt;</code></td>
- <td>Disable debug messages for the specified debug tag.</td>
-</tr>
-<tr>
- <td><code>-logcat &lt;logtags&gt;</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&nbsp;&lt;device&gt;</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>&lt;device&gt; must be a QEMU device type. See the documentation for 'serial -dev' at
- <a href="http://www.bellard.org/qemu/qemu-doc.html#SEC10">http://www.bellard.org/qemu/qemu-doc.html#SEC10</a>
- for a list of device types.</p>
-
-<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 &lt;name&gt;</code></td>
- <td>Display kernel messages.</td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>-trace &lt;name&gt;</code></td>
- <td>Enable code profiling (press F9 to start), written to a specified file.</td>
- <td>&nbsp;</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-&lt;tags&gt;.</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>&lt;-help-debug-tags&gt;</code>.</p>
-</td>
-</tr>
-<tr>
- <td rowspan="6">Media</td>
- <td><code>-audio &lt;backend&gt;</code></td>
- <td>Use the specified audio backend.</td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>-audio-in &lt;backend&gt;</code></td>
- <td>Use the specified audio-input backend.</td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>-audio-out &lt;backend&gt;</code></td>
- <td>Use the specified audio-output backend.</td>
- <td>&nbsp;</td>
-</tr>
-<!--<tr>
- <td><code>-mic &lt;device or file&gt;</code></td>
- <td>Use device or WAV file for audio input.</td>
- <td>&nbsp;</td>
-</tr>
--->
-<tr>
- <td><code>-noaudio</code></td>
- <td>Disable audio support in the current emulator instance.</td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>-radio &lt;device&gt;</code></td>
- <td>Redirect radio modem interface to a host character device.</td>
- <td>&nbsp;</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 &lt;servers&gt;</code></td>
- <td>Use the specified DNS server(s). </td>
- <td>The value of <code>&lt;servers&gt;</code> must be a comma-separated list of up to 4 DNS server names or
- IP addresses.</td>
-</tr>
-<tr>
- <td><code>-http-proxy &lt;proxy&gt;</code></td>
- <td>Make all TCP connections through a specified HTTP/HTTPS proxy</td>
- <td>The value of <code>&lt;proxy&gt;</code> can be one of the following:<br>
- <code>http://&lt;server&gt;:&lt;port&gt;</code><br>
- <code>http://&lt;username&gt;:&lt;password&gt;@&lt;server&gt;:&lt;port&gt;</code>
- <p>The <code>http://</code> prefix can be omitted. If the <code>-http-proxy &lt;proxy&gt;</code> command is not supplied,
- the emulator looks up the <code>http_proxy</code> environment variable and automatically uses any value matching
- the <code>&lt;proxy&gt;</code> format described above.</p></td>
-</tr>
-<tr>
- <td><code>-netdelay &lt;delay&gt;</code></td>
- <td>Set network latency emulation to &lt;delay&gt;.</td>
- <td>Default value is <code>none</code>. See the table in <a href="#netdelay">Network Delay Emulation</a> for
- supported <code>&lt;delay&gt;</code> values. </td>
-</tr>
-<tr>
- <td><code>-netfast</code></td>
- <td>Shortcut for <code>-netspeed full -netdelay none</code></td>
- <td>&nbsp;</td></tr>
-<tr>
- <td><code>-netspeed &lt;speed&gt;</code></td>
- <td>Set network speed emulation to &lt;speed&gt;.</td>
- <td>Default value is <code>full</code>. See the table in <a href="#netspeed">Network Speed Emulation</a> for
- supported <code>&lt;speed&gt;</code> values. </td>
-</tr>
-<tr>
- <td><code>-port &lt;port&gt;</code></td>
- <td>Set the console port number for this emulator instance to <code>&lt;port&gt;</code>.</td>
- <td>The console port number must be an even integer between 5554 and 5584, inclusive. <code>&lt;port&gt;</code>+1
- must also be free and will be reserved for ADB.</td>
-</tr>
-<tr>
- <td><code>-report-console &lt;socket&gt;</code></td>
- <td>Report the assigned console port for this emulator instance to a remote third party
- before starting the emulation. </td>
- <td><code>&lt;socket&gt;</code> must use one of these formats:
-
-<p><code>tcp:&lt;port&gt;[,server][,max=&lt;seconds&gt;]</code></br>
-<code>unix:&lt;port&gt;[,server][,max=&lt;seconds&gt;]</code></p>
-
-<p>Use <code>-help-report-console</code></p> to view more information about this topic. </td>
-</tr>
-<tr>
- <td rowspan="8">System</td>
- <td><code>-cpu-delay &lt;delay&gt;</code></td>
- <td>Slow down emulated CPU speed by &lt;delay&gt; </td>
- <td>Supported values for &lt;delay&gt; are integers between 0 and 1000.
-
-<p>Note that the &lt;delay&gt; does not correlate to clock speed or other absolute metrics
-&mdash; it simply represents an abstract, relative delay factor applied non-deterministically
-in the emulator. Effective performance does not always
-scale in direct relationship with &lt;delay&gt; values.</p>
-</td>
-</tr>
-<tr>
- <td><code>-gps &lt;device&gt;</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>&lt;device&gt;</code> must be QEMU-specific
- serial device specification. See the documentation for 'serial -dev' at
- <a href="http://www.bellard.org/qemu/qemu-doc.html#SEC10">http://www.bellard.org/qemu/qemu-doc.html#SEC10</a>.
-</td>
-</tr>
-<tr>
- <td><code>-nojni</code></td>
- <td>Disable JNI checks in the Dalvik runtime.</td><td>&nbsp;</td></tr>
-<tr>
- <td><code>-qemu</code></td>
- <td>Pass arguments to qemu.</td>
- <td>&nbsp;</td></tr>
-<tr>
- <td><code>-qemu -h</code></td>
- <td>Display qemu help.</td>
- <td></td></tr>
-<tr>
- <td><code>-radio &lt;device&gt;</code></td>
- <td>Redirect radio mode to the specified character device.</td>
- <td>The format of <code>&lt;device&gt;</code> must be QEMU-specific
- serial device specification. See the documentation for 'serial -dev' at
-<a href="http://www.bellard.org/qemu/qemu-doc.html#SEC10">http://www.bellard.org/qemu/qemu-doc.html#SEC10</a>.
-</td>
-</tr>
-<tr>
- <td><code>-timezone &lt;timezone&gt;</code></td>
- <td>Set the timezone for the emulated device to &lt;timezone&gt;, instead of the host's timezone.</td>
- <td><code>&lt;timezone&gt;</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>&nbsp;</td>
-</tr>
-<tr>
- <td rowspan="12">UI</td>
- <td><code>-dpi-device &lt;dpi&gt;</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>&nbsp;</td>
-</tr>
-<tr>
- <td><code>-scale &lt;scale&gt;</code></td>
- <td>Scale the emulator window. </td>
- <td><code>&lt;scale&gt;</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>&nbsp;</td></tr>
-<tr>
- <td><code>-noskin</code></td>
- <td>Don't use any emulator skin.</td>
- <td>&nbsp;</td></tr>
-<tr>
- <td><code>-keyset &lt;file&gt;</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 &lt;image&gt;</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 &lt;percent&gt;</code></td>
- <td>Specify onion skin translucency value (as percent).
- <td>Default is 50.</td>
-</tr>
-<tr>
- <td><code>-onion-rotation &lt;position&gt;</code></td>
- <td>Specify onion skin rotation.
- <td><code>&lt;position&gt;</code> must be one of the values 0, 1, 2, 3.</td>
-</tr>
-<tr>
- <td><code>-skin &lt;skinID&gt;</code></td>
- <td>Start the emulator with the specified skin. </td>
- <td>The SDK includes a <a href="#skins">choice of four skins</a>:<br />
- <li>HVGA-L (480x320, landscape)</li>
- <li>HVGA-P (320x480, portrait) (default) </li>
- <li>QVGA-L (320x240, landscape)</li>
- <li>QVGA-P (240x320, portrait) </li>
-</td>
-</tr>
-<tr>
- <td><code>-skindir &lt;dir&gt;</code></td>
- <td>Search for emulator skins in &lt;dir&gt;. </td>
- <td>&nbsp;</td></tr>
-</table>
-
-<a name="diskimages"></a>
-
-<h2>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
-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. The Android SDK includes default versions of the required images, stored
-in predetermined locations in the SDK directory structure. At startup, the
-emulator looks for and reads the image files, using their default names and
-storage locations. </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 the 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: system 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>
-
-<a name="systemimages"></a>
-<h3>System Images</h3>
-
-<p>System images contain system data and default settings without which the
-emulator can not run. The image files are read-only &mdash; the emulator reads
-the images at startup and does not modify them during the session.</p>
-
-<p>All of the system image files are stored in a single directory. By default,
-the system images are stored in the <code>lib/images</code>' under the
-emulator's program location. </p>
-
-<p>The emulator provides the <code>-system &lt;dir&gt;</code> startup option to
-let you override the location under which the emulator looks for the system
-images files. </p>
-
-<p>The emulator also provides startup options that let you override the names of
-the system images, as described in the table below. When you use one of the
-options, the emulator looks in the default directory, or in a custom location
-(if you specified <code>-system &lt;dir&gt;</code>). Note that, if you provide
-alternate system image file, it must contain the same type of data as the
-default. For example, your override of the system.img file must point to a disk
-image containing an Android system. </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 &lt;file&gt;</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 &lt;file&gt;</code></td>
-</tr>
-
-<tr>
- <td><code>system.img</code></td>
- <td>The <em>initial</em> Android system image.</td>
- <td>Override using <code>-image &lt;file&gt;</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 &lt;file&gt;</code>. Also see
-<code>-data &lt;file&gt;</code>, below.</td>
-</tr>
-
-</table>
-
-<a name="runtimeimages"></a>
-<h3>Runtime Images: User Data and SD Card</h3>
-
-<p>At runtime, the emulator reads and writes data on two disk images: a
-user-data image and (optionally) an SD card image. This emulates 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 default image in this location on
-on your development machine: </p>
-
-<ul>
- <li>Linux and OS X: <code>~/.android</code></li>
- <li>Windows: <code>C:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Android</code></li>
-</ul>
-
-<!--
-<p>The emulator provides a startup option, <code>-datadir &lt;dir&gt;</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 table below. When you use one
-of these options, the emulator looks for the specified file(s) in the current working directory,
-in the default 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 &lt;;filepath&gt;</code>, where <code>&lt;filepath&gt;</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>&lt;filepath&gt;</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 &lt;filepath&gt;</code>, where <code>&lt;filepath&gt;</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,
-at the default location, as described above, 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/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>If you are planning to run multiple emulator instances concurrently, note
-that only the first emulator instance can persist user-data, if no explicit
-user-data image file is specified in the startup command. When running multiple
-emulator instances, you must specify a name for the image file to use (or
-create), by using the <code>-data &lt;name&gt;</code> option with a unique
-<code>&lt;name&gt;</code> value. For more information, see
-<a href="#multipleinstances">Running Multiple Emulator Instances</a>.</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>
-
-<a name="temporaryimages"></a>
-<h3>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 &lt;file&gt;</code>, which specifies the name of the file at which
-to persist the <code>/cache</code> image at device power-off. If <code>&lt;file&gt;
-</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>
-
-
-<a name="emulatornetworking"></a>
-<h2>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>
-
-<a name="networkaddresses"></a>
-<h3>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 &mdash; all addresses managed by the router are in the form of
-10.0.2.&lt;xx&gt;, where &lt;xx&gt; 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>
-
-<a name="networkinglimitations"></a>
-<h3>Local Networking Limitations</h3>
-
-<p>Each emulator instance runs behind a virtual router, but unlike an actual
-device connected to a physical router, the emulated device doesn't have access
-to a physical network. Instead it runs as part of a normal application on your
-development machine. This means that it is subject to the same networking
-limitations as other applications on your machine:</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>
-
-<a name="redirections"></a>
-<h3>Using Network Redirections</h3>
-
-<p>To communicate with an emulator instance behind its virtual router, you need
-to set up network redirections 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 redirections, you create a mapping of host and guest
-ports/addresses on the the emulator instance. There are two ways to set up
-network redirections: using emulator console commands and using the ADB tool, as
-described below. </p>
-
-<a name="consoleredir"></a>
-<h4>Setting up Redirections 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 redirections 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 redirections.
-To add a redirection, use:</a>. </p>
-
-<pre><code>add&nbsp;&lt;protocol&gt;:&lt;host-port&gt;:&lt;guest-port&gt;</code>
-</pre>
-
-<p>where <code>&lt;protocol&gt;</code> is either <code>tcp</code> or <code>udp</code>,
-and <code>&lt;host-port&gt;</code> and <code>&lt;guest-port&gt;</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 will handle 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 redirections 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>
-
-<a name="adbredir"></a>
-<h4>Setting Up Redirections through ADB</h4>
-
-<p>The Android Debug Bridge (ADB) tool provides port forwarding, an alternate
-way for you to set up network redirections. For more information, see <a
-href="{@docRoot}reference/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>
-
-<a name="dns"></a>
-<h3>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 &lt;serverList&gt;</code> option to manually specify the
-addresses of DNS servers to use, where &lt;serverList&gt; 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>
-
-<a name="proxy"></a>
-<h3>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 &lt;proxy&gt;</code> option when starting the emulator, to
-set up the appropriate redirection. In this case, you specify proxy information
-in <code>&lt;proxy&gt;</code> in one of these formats:</p>
-
-<pre>http://&lt;machineName&gt;:&lt;port&gt;</pre>
-
-<p>or</p>
-
-<pre>http://&lt;username&gt;:&lt;password&gt;@&lt;machineName&gt;:&lt;port&gt;</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>&lt;proxy&gt;</code>. In this case, you do not need to specify a value for
-<code>&lt;proxy&gt;</code> in the <code>-http-proxy</code> command &mdash; 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>
-
-<a name="connecting"></a>
-<h3>Interconnecting Emulator Instances</h3>
-
-<p>To allow one emulator instance to communicate with another, you must set up
-the necessary network redirections 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, running on A too</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:&lt;serverPort&gt;</code></li>
- <li>On B's console, set up a redirection from
-<code>A:localhost:&lt;localPort&gt;</code> to <code>
-B:10.0.2.15:&lt;serverPort&gt;</code></li>
- <li>On C, have the client connect to 10.0.2.2:&lt;localPort&gt;</code></li>
-</ol>
-
-<p>For example, if you wanted to run an HTTP server, you can select
-<code>&lt;serverPort&gt;</code> as 80 and <code>&lt;localPort&gt;</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>
-
-<a name="calling"></a>
-<h3>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, you use the dialer application and SMS application (if available) installed on one emulator </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 (&lt;port&gt;). </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>.
-
-<a name="console"></a>
-
-<h2>Using the Emulator Console</h2>
-
-<p>Each running emulator instance includes a console facility that lets you dynamically query and control the simulated device environment. For example, you can use the console to dynamically manage port redirections and network characteristics and simulate telephony events. To access the console and enter commands, you 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 &lt;console-port&gt;</pre>
-
-<p>An emulator instance occupies a pair of adjacent ports: a console port and an adb port. The port numbers differ by 1, with the adb port having the higher port number. The console of the first emulator instance running on a given machine uses console port 5554 and adb port 5555. Subsequent instances use port numbers increasing by two &mdash; 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}reference/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 sections below describe the major functional areas of the console.</p>
-
-<a name="portredirection"></a>
-
-<h3>Port Redirection</h3>
-<p>You can use the console to add and remove port redirections while the emulator is running. After connecting to the console, you can manage port redirections in this way:</p>
-<pre>redir &lt;list|add|del&gt; </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 redirections.</td>
- <td>&nbsp;</td>
- </tr>
-
-
-<tr>
- <td><code>add&nbsp;&lt;protocol&gt;:&lt;host-port&gt;:&lt;guest-port&gt;</code></td>
- <td>Add a new port redirection.</td>
-<td><li>&lt;protocol&gt; must be either &quot;tcp&quot; or &quot;udp&quot;</li>
-<li>&lt;host-port&gt; is the port number to open on the host</li>
-<li>&lt;guest-port&gt; is the port number to route data to on the emulator/device</li></td>
-</tr>
-<tr>
- <td><code>del &lt;protocol&gt;:&lt;host-port&gt;</code></td>
- <td>Delete a port redirection.</td>
-<td>See above for meanings of &lt;protocol&gt; and &lt;host-port&gt;.</td>
-</tr>
-</table>
-
-<a name="geo"></a>
-<h3>Geo Location Provider Emulation</h3>
-
-<p>The console provides commands to let you set the geo position used by an emulator emulated device. You can use the <code>geo</code> command to send a simple GPS fix to the emulator, without needing to use NMEA 1083 formatting. The usage for the command is: </p>
-
-<pre>geo &lt;fix|nmea&gt;</pre>
-
-<p>The <code>geo</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>fix &lt;longitude&gt; &lt;latitude&gt; [&lt;altitude&gt;]</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 &lt;sentence&gt;</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>&lt;sentence&gt;</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 to fix the GPS location as soon as an emulator instance is running. The emulator creates a mock location provider that sends the location to GPS-aware applications as soon as they start and register location listeners. 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} and its methods.</p>
-
-<a name="events"></a>
-<h3>Hardware Events Emulation</h3>
-
-<p>You can use the <code>event</code> command to send various events to the emulator.The usage for the command is: </p>
-
-<pre>event &lt;send|types|codes|text&gt;</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 &lt;type&gt;:&lt;code&gt;:&lt;value&gt; [...]</code></td>
- <td>Send one or more events to the Android kernel. </td>
- <td>You can use text names or integers for <code>&lt;type&gt;</code> and <code>&lt;value&gt;</code>.</td>
- </tr>
-<tr>
- <td><code>types</code></td>
- <td>List all <code>&lt;type&gt;</code> string aliases supported by the <code>event</code> subcommands.</td>
-<td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>codes &lt;type&gt;</code></td>
- <td>List all <code>&lt;codes&gt;</code> string aliases supported by the <code>event</code>
- subcommands for the specified <code>&lt;type&gt;</code>.</td>
-<td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>event text &lt;message&gt;</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>
-
-<a name="power"></a>
-<h3>Device Power Characteristics</h3>
-
-<p>You can use the <code>power</code> command to control the simulated power state of the emulator instance.The usage for the command is: </p>
-
-<pre>power &lt;display|ac|status|present|health|capactiy&gt;</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>display</code></td>
- <td>Display battery and charger state.</td>
- <td>&nbsp;</td>
- </tr>
-<tr>
- <td><code>ac &lt;on|off&gt;</code></td>
- <td>Set AC charging state to on or off. </td>
-<td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>status &lt;unknown|charging|discharging|not-charging|full&gt;</code></td>
- <td>Change battery status as specified.</td>
-<td>&nbsp;</td>
-</tr>
-
-<tr>
- <td><code>present &lt;true|false&gt;</code></td>
- <td>Set battery presence state.</td>
-<td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>health &lt;unknown|good|overheat|dead|overvoltage|failure&gt;</code></td>
- <td>Set battery health state.</td>
-<td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>power health &lt;percent&gt;</code></td>
- <td>Set remaining battery capacity state (0-100).</td>
-<td>&nbsp;</td>
-</tr>
-</table>
-
-<a name="netstatus"></a>
-<h3>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>
-
-<a name="netdelay"></a>
-<h3>Network Delay Emulation</h3>
-
-<p>The emulator lets you simulate various network latency levels, so that you can test your applicaton 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 dynamically, 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>&lt;delay&gt;</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 dynamic changes to network delay while the emulator is running, connect to the console and use the <code>netdelay</code> command with a supported <code>&lt;delay&gt;</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</td>
- <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>&lt;num&gt;</code></td>
-<td>Emulate an exact latency (milliseconds).</td>
-<td>&nbsp;</td></tr>
-<tr><td><code>&lt;min&gt;:&lt;max&gt;</code></td>
-<td>Emulate an specified latency range (min, max milliseconds).</td>
-<td>&nbsp;</td></tr>
-</table>
-
-<a name="netspeed"></a>
-<h3>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 dynamically, 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>&lt;speed&gt;</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 dynamic changes to network speed while the emulator is running, connect to the console and use the <code>netspeed</code> command with a supported <code>&lt;speed&gt;</code> value from the table below. </p>
-
-<pre>network speed 14.4 80</pre>
-
-<p>The format of network <code>&lt;speed&gt;</code> is one of the following (numbers are
-kilobits/sec):</p>
-<table style="clear:right;width:100%;">
-<tbody>
-<tr>
- <th width="30%">Value</td>
- <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>&lt;num&gt;</code></td>
- <td>Set an exact rate used for both upload and download.</td><td></td></tr>
-<tr>
- <td><code>&lt;up&gt;:&lt;down&gt;</code></td>
- <td>Set exact rates for upload and download separately.</td><td></td></tr>
-</table>
-
-
-<a name="telephony"></a>
-
-<h3>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 and establish/terminate data connections. The Android system handles simulated calls exactly as it would actual calls. The emulator does not support call audio in this release. </p>
-<p>You can use the console to access the emulator's telephony functions. After connecting to the console, you can use</p>
-<pre>gsm &lt;call|accept|busy|cancel|data|hold|list|voice|status&gt; </pre>
-<p>to invoke telephony functions. </p>
-<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 &lt;phonenumber&gt;</code></td>
- <td>Simulate an inbound phone call from &lt;phonenumber&gt;.</td>
- <td>See also <a href="#calling">Sending a Voice Call or SMS to another Emulator Instance</a>.</td>
- </tr>
- <tr>
- <td><code>accept &lt;phonenumber&gt;</code></td>
- <td>Accept an inbound call from &lt;phonenumber&gt; 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 &lt;phonenumber&gt;</code></td>
- <td>Close an outbound call to &lt;phonenumber&gt; 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 &lt;phonenumber&gt;</code></td>
- <td>Terminate an inbound or outbound phone call to/from &lt;phonenumber&gt;.</td>
- <td>&nbsp;</td>
- </tr>
- <tr>
- <td><code>data &lt;state&gt;</code></td>
- <td>Change the state of the GPRS data connection to &lt;state&gt;.</td>
- <td>Supported &lt;state&gt; values are:<br />
- <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> </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>&nbsp;</td>
- </tr>
- <tr>
- <td><code>voice &lt;state&gt;</code></td>
- <td>Change the state of the GPRS voice connection to &lt;state&gt;.</td>
- <td>Supported &lt;state&gt; values are:<br />
- <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></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>
-
-<a name="sms"></a>
-
-<h3>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 this command:</p>
-
-<pre>sms send &lt;senderPhoneNumber&gt; &lt;textmessage&gt;</pre>
-
-<p>where <code>&lt;senderPhoneNumber&gt;</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>
-
-<a name="vm"></a>
-
-<h3>VM State</h3>
-
-<p>You can use the <code>vm</code> command to control the VM on an emulator instance.The usage for the command is: </p>
-
-<pre>vm &lt;start|stop|status&gt;</pre>
-
-<p>The <code>vm</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>start</code></td>
- <td>Start the VM on the instance. </td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>stop</code></td>
- <td>Stop the VM on the instance. </td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td><code>start</code></td>
- <td>Display the current status of the VM (running or stopped). </td>
- <td>&nbsp;</td>
-</tr>
-</table>
-
-
-<a name="window"></a>
-
-<h3>Emulator Window</h3>
-
-<p>You can use the <code>window</code> command to manage the emulator window. The usage for the command is: </p>
-
-<pre>window &lt;scale&gt;</pre>
-
-<p>The <code>vm</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>scale &lt;scale&gt;</code></td>
- <td>Scale the emulator window.</td>
- <td>&lt;scale&gt; must be a number between 0.1 and 3 that describes 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>
-</table>
-
-
-<a name="terminating"></a>
-
-<h3>Terminating an Emulator Instance</h3>
-
-<p>You can terminate an emulator instance through the console, using the <code>kill</code> command.</p>
-
-
-<a name="skins"></a>
-
-<h2>Using Emulator Skins</h2>
-
-<p>You can run the emulator with any of four default skins, as described in the table below. To specify a skin, use <code>-skin &lt;skinID&gt;</code> when starting the emulator. </p>
-
-<p>For example: </p>
-
-<pre>emulator -skin HVGA-L</pre>
-
-<p>Note that you must enter the <code>&lt;skinID&gt;</code> in uppercase letters (if your development computer is case-sensitive).</p>
-
-<table border="0" style="clear:left;padding:2em;">
- <tr>
- <th width="20%">skinID</th>
- <th >Description</th>
- <th >Skin</th>
- </tr>
- <tr>
- <td><code>HVGA-L</code></td>
- <td>480x320, landscape</td>
- <td><img src="{@docRoot}images/e-mini-hvga-l.png" width="219" height="113"></td>
- </tr>
- <tr>
- <td><code>HVGA-P</code></td>
- <td>320x480, portrait (default)</td>
- <td><img src="{@docRoot}images/e-mini-hvga-p.png" width="113" height="219"></td>
- </tr>
- <tr>
- <td><code>QVGA-L</code></td>
- <td>320x240, landscape</td>
- <td><img src="{@docRoot}images/e-mini-qvga-l.png" width="119" height="197"></td>
- </tr>
- <tr>
- <td><code>QVGA-P</code></td>
- <td>240x320, portrait</td>
- <td><img src="{@docRoot}images/e-mini-qvga-p.png" width="95" height="173"></td>
- </tr>
-</table>
-
-<a name="multipleinstances"></a>
-
-<h2>Running Multiple Emulator Instances</h2>
-
-<p>You can run multiple instances of the emulator concurrently, if necessary. Each emulator instance can use a separate user-data image file and a different console port. This lets you manage each instance in isolation. </p>
-
-<p>However, if you will run multiple emulator instances, note that there are limitations on the capability of each instance to maintain its persistent user data &mdash; user settings and installed applications &mdash; across sessions. Specifically:</p>
-
-<ul>
- <li>By default, only the first-launched emulator instance can preserve user data across sessions. When a session closes,
- the emulator stores the user data to a user-data image file &mdash; by default, it stores the data in the file
- <code>~/.android/userdata-qemu.img </code>(on Linux and Mac) or <code>C:\Documents and Settings\&lt;user&gt;\Local
- Settings\Application Data\Android\userdata-qemu.img</code> (on Windows) in your development computer.</li>
-
-<li>Emulator instances that you start after the first instance (that are running concurrently) can also store user data during a session, but they <em>do not</em> preserve it for the next session, unless you have specified a unique user-data image file in which the data should be stored. </li>
-
-</ul>
-
-<p>To run multiple emulator instances and let each maintain user data across sessions, start the instances with the <code>-data</code> option (see <a href="#startup-options">Startup Options</a>) and supply the path to a user-data file. </p>
-
-<a name="apps"></a>
-
-<h2>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 <a href="{@docRoot}reference/adb.html#move">using
-the adb utility</a>. Before installing the application, you need to package it
-in a .apk file using the <a href="aapt.html">Android Asset Packaging Tool</a>.
-Once the application is installed, you can start the emulator from the command
-line, as described in this document, using any startup options necessary.
-When the emulator is running, you can also connect to the emulator instance's
-console 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>
-
-<a name="sdcard"></a>
-
-<h2>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. The sections below describe how to create the 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 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>
-
-<a name="creating"></a>
-
-<h3>Creating a Disk Image</h3>
-
-<p>You can 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 &lt;size&gt; &lt;file&gt;</pre>
-
-<p>For example:</p>
-
-<pre>mksdcard 1024M sdcard1.iso</pre>
-
-<p>For more information, see <a href="{@docRoot}reference/othertools.html">Other Tools</a>. </p>
-
-<a name="copying"></a>
-<h3>Copying Files to a Disk 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 mtools to copy the files directly to the image. The mtools package is available for Linux, Mac, and Windows.</p>
-
-<a name="loading"></a>
-<a name="step3" id="step3"></a>
-
-<h3>Loading the Disk Image at Emulator Startup</h3>
-<p>To load FAT32 disk image in the emulator, 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 &lt;filepath&gt;</pre>
-
-<a name="troubleshooting"></a>
-
-<h2>Troubleshooting Emulator Problems</h2>
-
-<p>The adb utility sees the emulator as an actual physical device. For this reason, you might have to use the -d flag with some common adb commands, such as <code>install</code>. The -d flag lets you specify which of several connected devices to use as the target of a command. If you don't specify -d, the emulator will target the first device in its list. For more information about adb, see <a href="{@docRoot}reference/adb.html">Android Debug Bridge</a>.</p>
-
-<p>For emulators running on Mac OS X, if you see an error &quot;Warning: No DNS servers found&quot; 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}kb/index.html">Frequently Asked Questions</a> for more troubleshooting information. </p>
-
-<a name="limitations"></a>
- <h2>Emulator Limitations</h2>
- <p>In this release, the 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 camera/video capture (input).</li>
- <li>No support for device-attached headphones</li>
- <li>No support for determining 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>
diff --git a/docs/html/guide/developing/hierarchy-viewer.jd b/docs/html/guide/developing/hierarchy-viewer.jd
deleted file mode 100644
index 065211c..0000000
--- a/docs/html/guide/developing/hierarchy-viewer.jd
+++ /dev/null
@@ -1,99 +0,0 @@
-page.title=Hierarchy Viewer
-@jd:body
-
-<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 Layout View) and a magnified inspector of the display (the Pixel Perfect View).
-</p>
-
-<p>To get the Hierarchy Viewer started:</p>
-<ol>
- <li>Connect your device or launch an emulator.</li>
- <li>From a terminal, launch <code>hierarchyviewer</code> from your SDK
- <code>/tools</code> directory.
- </li>
- <li>In the window that opens, you'll see a list of <strong>Devices</strong>. When a device is
- selected, a list of currently active <strong>Windows</strong> is displayed
- on the right. The <em>&lt;Focused Window></em> is the window currently in
- the foreground, and also the default window loaded if you do not select another.
- </li>
- <li>Select the window that you'd like to inspect and click
- <strong>Load View Hierarchy</strong>. The Layout View will be loaded.
- You can then load the Pixel Perfect View by clicking the second
- icon at the bottom-left of the window.
- </li>
-</ol>
-
-<p>If you've navigated to a different window on the device, press <strong>Refresh Windows</strong>
-to refresh the list of available windows on the right.</p>
-
-<h2>Layout View</h2>
-<p>The Layout View offers a look at the View layout and properties. It has three views:</p>
-<ul>
- <li>Tree View: a hierarchy diagram of the Views, on the left.</li>
- <li>Properties View: a list of the selected View's properties, on the top-right.</li>
- <li>Wire-frame View: a wire-frame drawing of the layout, on the bottom-right.</li>
-</ul>
-<br/>
-<img src="/android/images/hierarchyviewer-layout.png" alt="" height="509" width="700" />
-
-<p>Select a node in the Tree View to display the properties of that element in
-the Properties View. When a node is selected, the Wire-frame View
-also indicates the bounds of the element with a red rectangle.
-Double click a node in the tree (or select it, and click <strong>Display
-View</strong>) to open a new window with a rendering of that element.</p>
-
-<p>The Layout View includes a couple other helpful features for debugging your layout:
-<strong>Invalidate</strong> and <strong>Request Layout</strong>. These buttons execute the
-respective View calls, {@link android.view.View#invalidate()} and {@link android.view.View#requestLayout()},
-on the View element currently selected in the tree. Calling these methods on any View can
-be very useful when simultaneously running a debugger on your application.</p>
-
-<p>The Tree View can be resized by adjusting the zoom slider, below
-the diagram. The number of View elements in the window is also given here. You
-should look for ways to minimize the number of Views. The fewer View elements there
-are in a window, the faster it will perform.</p>
-
-<p>If you interact with the device and change the focused View, the diagram will not automatically refresh.
-You must reload the Layout View by clicking <strong>Load View Hierarchy</strong>.
-
-
-<h2>Pixel Perfect View</h2>
-<p>The Pixel Perfect View provides a magnified look at the current device window. It has three views:</p>
-<ul>
- <li>Explorer View: shows the View hierarchy as a list, on the left.</li>
- <li>Normal View: a normal view of the device window, in the middle.</li>
- <li>Loupe View: a magnified, pixel-grid view of the device window, on the right.</li>
-</ul>
-<br/>
-<img src="/android/images/hierarchyviewer-pixelperfect.png" alt="" height="509" width="700" />
-
-<p>Click on an element in the Explorer View and a "layout box" will be drawn in the
-Normal View to indicate the layout position of that element. The layout box uses multiple rectangles, to indicate the normal bounds, the padding and the margin (as needed). The purple or green rectangle indicates
-the normal bounds of the element (the height and width). The inner white or black rectangle indicates
-the content bounds, when padding is present. A black or white rectangle outside the normal purple/green
-rectangle indicates any present margins.
-(There are two colors for each rectangle, in order to provide the best contrast
-based on the colors currently in the background.)</p>
-
-<p>A very handy feature for designing your UI is the ability to overlay an image in the Normal and Loupe
-Views. For example, you might have a mock-up image of how you'd like to layout your interface.
-By selecting <strong>Load...</strong> from the controls in the Normal View, you can choose the
-image from your computer and it will be placed atop the preview. Your chosen image will anchor at the bottom left corner of the screen. You can then adjust the opacity of the overlay and begin fine-tuning your layout to match the mock-up.</p>
-
-<p>The Normal View and Loupe View refresh at regular intervals (5 seconds by default), but the
-Explorer View does not. If you navigate away and focus on a different View, then you should refresh the
-Explorer's hierarchy by clicking <strong>Load View Hierarchy</strong>. This is even true
-when you're working in a window that holds multiple Views that are not always visible. If you do not,
-although the previews will refresh, clicking a View in the Explorer will not provide the proper layout box
-in the Normal View, because the hierarchy believes you are still focused on the prior View.</p>
-
-<p>Optional controls include:</p>
-<ul>
- <li><strong>Overlay</strong>: Load an overlay image onto the view and adjust its opacity.</li>
- <li><strong>Refresh Rate</strong>: Adjust how often the Normal and Loupe View refresh their display.</li>
- <li><strong>Zoom</strong>: Adjust the zoom level of the Loupe View.</li>
-</ul>
-
-<p><strong><a href="/android/intro/tools.html">Back to Development Tools</a></strong></p>
-
diff --git a/docs/html/guide/developing/instrumentation/index.jd b/docs/html/guide/developing/instrumentation/index.jd
index 1c1ab14..7ebd72e 100644
--- a/docs/html/guide/developing/instrumentation/index.jd
+++ b/docs/html/guide/developing/instrumentation/index.jd
@@ -3,7 +3,7 @@ page.title=Instrumentation
<dl>
<dt><a href="inst-framework.html">Instrumentation Framework</a></dt>
- <dt><a href="inst-testing">Instrumentation Testing</a></dt>
+ <dt><a href="inst-testing.html">Instrumentation Testing</a></dt>
</dl>
<!--
@@ -18,7 +18,7 @@ page.title=Instrumentation
<li>Take a performance snapshot, and
<li>Attach an
-When running with instrumentation turned on, the system instantiates class will be instantiated for you before any of the application code, allowing you to monitor all of the interaction the system has with the application. An Instrumentation implementation is described to the system through an AndroidManifest.xml's <instrumentation> tag.
+When running with instrumentation turned on, the system instantiates class will be instantiated for you before any of the application code, allowing you to monitor all of the interaction the system has with the application. An Instrumentation implementation is described to the system through an AndroidManifest.xml's &lt;instrumentation> tag.
<ul>
@@ -47,7 +47,7 @@ When running with instrumentation turned on, the system instantiates class will
<a href="glossary.html">UI Elements and Concepts Glossary</a>
</li>
<li>
- <a href="{@docRoot}guide/tutorials/views/hello-views-index.html">Hello Views</a>
+ <a href="{@docRoot}guide/tutorials/views/index.html">Hello Views</a>
</li>
</ul>
diff --git a/docs/html/guide/developing/instrumentation/inst-framework.jd b/docs/html/guide/developing/instrumentation/inst-framework.jd
index 16f78bb..17eea61 100644
--- a/docs/html/guide/developing/instrumentation/inst-framework.jd
+++ b/docs/html/guide/developing/instrumentation/inst-framework.jd
@@ -50,7 +50,7 @@ For example, to start the Contacts application you can use
<li> <code>adb install Contactstests.apk</code>: Installs the apk on the device. </li>
<li> Use the adb shell <code>am</code> command to run them. </li>
</ul>
-<p> For options and other details, please see <a href="instrumentation_testing.html" target="_top">Instrumentation Testing</a>.</p>
+<p> For options and other details, please see <a href="inst-testing.html">Instrumentation Testing</a>.</p>
<a name="androidInstrumentationFrameworkTestCase"></a><h2>Exploring a Test Case</h2>
@@ -137,33 +137,3 @@ E/AndroidRuntime( 688): ERROR: thread attach failed
</pre>
<p>It's possible that the instrumentation apk isn't installed on your device or that the package name is incorrect in the Manifest file. </p>
-
-<p><span class="lh2"><a name="androidFooter"></a></span>
-
- </div>
- </div>
- <!-- end gc-pagecontent -->
- </div>
- <!-- end gooey wrapper -->
- </div>
- <!-- end codesearchresults -->
- <div id="gc-footer" dir="ltr">
- <div class="text"> &copy;2008 Google<!-- - <a href="/">Code Home</a> - <a href="http://www.google.com/accounts/TOS">Site Terms of Service</a> - <a href="http://www.google.com/privacy.html">Privacy Policy</a> - <a href="/more">Site Directory</a> --></div>
- </div>
- <!-- end gc-footer -->
-</div>
-<!-- end gc-containter -->
-<script src="http://www.google-analytics.com/ga.js" type="text/javascript">
-</script>
-<script type="text/javascript">
- try {
- var pageTracker = _gat._getTracker("UA-18071-1");
- pageTracker._setAllowAnchor(true);
- pageTracker._initData();
- pageTracker._trackPageview();
- } catch(e) {}
-</script>
-<div id="jd-build-id"> v0.3 - 9 June 2008</div>
-</div></div></div></body>
-</html>
-
diff --git a/docs/html/guide/developing/instrumentation/inst-testing.jd b/docs/html/guide/developing/instrumentation/inst-testing.jd
index 09b0196..6f69344 100644
--- a/docs/html/guide/developing/instrumentation/inst-testing.jd
+++ b/docs/html/guide/developing/instrumentation/inst-testing.jd
@@ -205,32 +205,3 @@ function debugtest {
</pre>
-<p><span class="lh2"><a name="androidFooter"></a></span>
-
- </div>
- </div>
- <!-- end gc-pagecontent -->
- </div>
- <!-- end gooey wrapper -->
- </div>
- <!-- end codesearchresults -->
- <div id="gc-footer" dir="ltr">
- <div class="text"> &copy;2008 Google<!-- - <a href="/">Code Home</a> - <a href="http://www.google.com/accounts/TOS">Site Terms of Service</a> - <a href="http://www.google.com/privacy.html">Privacy Policy</a> - <a href="/more">Site Directory</a> --></div>
- </div>
- <!-- end gc-footer -->
-</div>
-<!-- end gc-containter -->
-<script src="http://www.google-analytics.com/ga.js" type="text/javascript">
-</script>
-<script type="text/javascript">
- try {
- var pageTracker = _gat._getTracker("UA-18071-1");
- pageTracker._setAllowAnchor(true);
- pageTracker._initData();
- pageTracker._trackPageview();
- } catch(e) {}
-</script>
-<div id="jd-build-id"> v0.3 - 9 June 2008</div>
-</div></div></div></body>
-</html>
-
diff --git a/docs/html/guide/developing/monkey.jd b/docs/html/guide/developing/monkey.jd
deleted file mode 100644
index d829f5b..0000000
--- a/docs/html/guide/developing/monkey.jd
+++ /dev/null
@@ -1,240 +0,0 @@
-page.title=UI/Application Exerciser Monkey
-@jd:body
-
-<p>The Monkey is a program that runs on your
-<a href="{@docRoot}reference/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] &lt;event-count&gt;</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 &lt;seed&gt;</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 &lt;milliseconds&gt;</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 &lt;percent&gt;</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 &lt;percent&gt;</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 &lt;percent&gt;</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 &lt;percent&gt;</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 &lt;percent&gt;</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 &lt;percent&gt;</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 &lt;percent&gt;</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 &lt;percent&gt;</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 &lt;allowed-package-name&gt;</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 &mdash; one -p
-option per package.</td>
-</tr>
-
-<tr>
-<td><code>-c &lt;main-category&gt;</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 &mdash; 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}reference/traceview.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/other-ide.jd b/docs/html/guide/developing/other-ide.jd
index dc7c11d..78871c5 100644
--- a/docs/html/guide/developing/other-ide.jd
+++ b/docs/html/guide/developing/other-ide.jd
@@ -53,7 +53,7 @@ activity_name: ActivityName
</ul>
<p>You can now move your folder wherever you want for development, but keep in mind
- that you'll have to use the <a href="{@docRoot}reference/adb.html">adb</a> program in the <code>tools/</code> folder to
+ that you'll have to use the <a href="{@docRoot}guide/developing/tools/adb.html">adb</a> program in the <code>tools/</code> folder to
send files to the emulator, so you'll need access between your solution and
the <code>tools/</code> folder. </p>
@@ -61,10 +61,8 @@ activity_name: ActivityName
location of the SDK directory, since this will break the build scripts (they
will need to be manually updated to reflect the new SDK location before they will
work again).</p>
-
-<a name="buildingwithant"></a>
-
-<h2>Building an Android Application</h2>
+<a name="buidingwithant"></a>
+<h2 id="antbuild">Building the Application with Ant</h2>
<p>Use the Ant <code>build.xml</code> file generated by
<code>activityCreator</code> to build your application.</p>
<ol>
@@ -87,7 +85,7 @@ activity_name: ActivityName
<h2>Running an Android Application</h2>
<p>To run a compiled
application, you will upload the .apk file to the <code>/data/app/ </code>directory
- in the emulator using the <a href="{@docRoot}reference/adb.html">adb</a> tool as described here:</p>
+ in the emulator using the <a href="{@docRoot}guide/developing/tools/adb.html">adb</a> tool as described here:</p>
<ol>
<li>Start the emulator (run <code><em>&lt;your_sdk_dir&gt;</em>/tools/emulator</code> from the command line)</li>
<li>On the emulator, navigate to the home screen (it is best not to have that
@@ -114,7 +112,7 @@ activity_name: ActivityName
but you can configure other IDEs to listen on a debugging port to receive debugging
information.</p>
<ol>
- <li><strong>Start the <a href="{@docRoot}reference/ddms.html">Dalvik Debug Monitor Server (DDMS)
+ <li><strong>Start the <a href="{@docRoot}guide/developing/tools/ddms.html">Dalvik Debug Monitor Server (DDMS)
tool </a>, </strong> which
acts as a port forwarding service between your IDE and the emulator.</li>
<li><strong>Set
@@ -127,22 +125,4 @@ activity_name: ActivityName
include information on <a href="#eclipse">how to set up Eclipse to debug
your project</a>. </li>
-<a name="eclipse" id="eclipse"></a>
-
</ol>
-<h2>Configuring your IDE to attach to the debugging port</h2>
-
-<p>DDMS will assign 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 &quot;Wait for debugger&quot; 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 &quot;Wait for debugger&quot;
- 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> \ No newline at end of file
diff --git a/docs/html/guide/developing/othertools.jd b/docs/html/guide/developing/othertools.jd
deleted file mode 100755
index 4ebcf4a..0000000
--- a/docs/html/guide/developing/othertools.jd
+++ /dev/null
@@ -1,104 +0,0 @@
-page.title=Other Tools
-@jd:body
-
-<p>The sections below describe other tools that you can use when building Android applications. </p>
-
-<p>All of the tools are included in the Android SDK and are accessible from the <code>tools/</code> directory.</p>
-
-<h2>Contents</h2>
-
-<dl>
- <dt><a href="#mksdcard">mksdcard</a></dt>
- <dt><a href="#dx">dx</a></dt>
- <dt><a href="#activitycreator">activitycreator</a></dd>
-</dl>
-
-<a name="mksdcard"></a>
-
-<h2>mksdcard</h2>
-
-<p>The mksdcard 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. Here is the usage for mksdcard:</p>
-
-<pre>mksdcard [-l label] &lt;size&gt;[K|M] &lt;file&gt;</pre>
-
-</p>The table below lists the available options/arguments</p>
-
-<table>
-<tr>
- <th>Argument</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 &lt;size&gt;. 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 -sdcard option. For more information, see <a href="{@docRoot}reference/emulator.html">Android Emulator</a>.</p>
-
-<pre>emulator -sdcard &lt;file&gt;</pre>
-
-<a name="dx"></a>
-
-<h2>dx</h2>
-
-<p>The dx tool lets you generate Android bytecode from .class files. The tool converts target files and/or directories to Dalvik executable format (.dex) files, so that they can run in the Android environment. It can also dump the class files in a human-readable format and run a target unit test. You can get the usage and options for this tool by using <code>dx -help</code>.</p>
-
-<a name="activitycreator"></a>
-
-<h2>activitycreator</h2>
-
-<p>If you aren't using the Eclipse IDE and ADT plugin, you can use the the activitycreator script to get started with a new application. When you run the script, it creates the structure of a minimal Android application that you can build on and extend to meet your needs. </p>
-
-<p>For Linux and Mac, the SDK provides <code>activitycreator.py</code>, a Python script, and for Windows <code>activitycreator.bat</code>, a batch script that runs an executable. Regardless of platform, the usage for the script is the same:</p>
-
-<pre>activitycreator [--out &lt;folder&gt;] [--ide intellij] your.package.name.ActivityName</pre>
-
-<table>
-<tr>
- <th>Option</th>
- <th>Description</th>
-</tr>
-
-<tr>
- <td><code>--out &lt;folder&gt;</code></td>
- <td>Specifies where to create the files/folders. </td>
-</tr>
-
-<tr>
- <td><code>--ide intellij</code></td>
- <td>Creates project files for IntelliJ</td>
-</tr>
-
-</table>
-
-
-<p>When run, the script creates these files: </p>
-
- <ul>
- <li>AndroidManifest.xml -- The application manifest file.</li>
- <li>build.xml -- An Ant script to build/package the application.</li>
- <li>res -- The resource directory.</li>
- <li>src -- The source directory.</li>
- <li>src/your/package/name/ActivityName.java -- The Activity class. </li>
- <li>bin -- The output folder for the compiled .apk (when built by Ant).</li>
-</ul>
-
-<p>When you are ready, you can use Ant to <a href="{@docRoot}intro/installing.html#buildingwithant">build the project</a> so that you can run it on the emulator.</p>
-
-<p>If you are using Eclipse with the ADT plugin, you do not need to use activitycreator. You can use the New Project Wizard, provided by the ADT plugin, instead. </p>
-
-
diff --git a/docs/html/guide/developing/tools.jd b/docs/html/guide/developing/tools.jd
deleted file mode 100644
index eab005d..0000000
--- a/docs/html/guide/developing/tools.jd
+++ /dev/null
@@ -1,112 +0,0 @@
-page.title=Tools Overview
-@jd:body
-
-<img src="{@docRoot}images/android_icon_125.png" alt="android_robot" align="right" width="125" height="137"">
-
-<p>The Android SDK includes a variety of custom tools that help you develop mobile
-applications on the Android platform. The most important of these are the Android
-Emulator and the Android Development Tools plugin for Eclipse, but the SDK also
-includes a variety of other tools for debugging, packaging, and installing your
-applications on the emulator. </p>
-
-<dl>
- <dt><a href="{@docRoot}reference/emulator.html">Android Emulator</a></dt>
- <dd>A virtual mobile device that runs on your computer. You use the emulator to design,
- debug, and test your applications in an actual Android run-time environment. </dd>
-
- <dt><a href="{@docRoot}reference/hierarchy-viewer.html">Hierarchy Viewer</a>
- <sup class="new">New!</sup></dt></dt>
- <dd>The Hierarchy Viewer tool allows you to debug and optimize your user interface.
- It provides a visual representation of your layout's hierarchy of Views and a magnified inspector
- of the current display with a pixel grid, so you can get your layout just right.
- </dd>
-
- <dt><a href="{@docRoot}reference/draw9patch.html">Draw 9-patch</a>
- <sup class="new">New!</sup></dt>
- <dd>The Draw 9-patch tool 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="{@docRoot}intro/installing.html#installingplugin">Android
- Development Tools Plugin</a> for the Eclipse IDE</dt>
- <dd>The ADT plugin adds powerful extensions to the Eclipse integrated environment,
- making creating and debugging your Android applications easier and faster. If you
- use Eclipse, the ADT plugin gives you an incredible boost in developing Android
- applications:
- </dd>
-
- <ul>
- <li>It gives you access to other Android development tools from inside
- the Eclipse IDE. For example, ADT lets you access the many capabilities of the
- DDMS tool &mdash; taking screenshots, managing port-forwarding, setting breakpoints,
- and viewing thread and process information &mdash; directly from Eclipse.
- <li>It provides a New Project Wizard, which helps you quickly create and set up
- all of the basic files you'll need for a new Android application.</li>
- <li>It automates and simplifies the process of building your Android application.</li>
- <li>It provides an Android code editor that helps you write valid XML for your
- Android manifest and resource files.</li>
- </ul>
-
- <p>For more information about the ADT plugin, including
- installation instructions, see <a
- href="{@docRoot}intro/installing.html#installingplugin"
- title="ADT Plugin for Eclipse">Installing the ADT Plugin for
- Eclipse</a>. For a usage example with screenshots, see <a
- href="{@docRoot}intro/hello-android.html" title="Hello
- Android">Hello Android</a>.</p>
-
- <dt><a href="{@docRoot}reference/ddms.html" >Dalvik Debug Monitor
- Service</a> (ddms)</dt>
- <dd>Integrated with Dalvik, the Android platform's custom VM, this tool
- lets you manage processes on an emulator or device and assists in debugging.
- You can use it to kill processes, select a specific process to debug,
- generate trace data, view heap and thread information, take screenshots
- of the emulator or device, and more. </dd>
-
- <dt><a href="{@docRoot}reference/adb.html" >Android Debug Bridge</a> (adb)</dt>
- <dd>The adb tool lets you install your application's .apk files on an
- emulator or device and access the emulator or device from a command line.
- You can also use it to link a standard debugger to application code running
- on an Android emulator or device.</dd>
-
- <dt><a href="{@docRoot}reference/aapt.html" >Android Asset
- Packaging Tool</a> (aapt)</dt>
- <dd>The aapt tool lets you create .apk files containing the binaries and
- resources of Android applications.</dd>
-
- <dt><a href="{@docRoot}reference/aidl.html" >Android Interface
- Description Language</a> (aidl)</dt>
- <dd>Lets you generate code for an interprocess interface, such as what
- a service might use.</dd>
-
- <dt><a href="{@docRoot}reference/adb.html#sqlite">sqlite3</a></dt>
- <dd>Included as a convenience, this tool lets you access the SQLite data
- files created and used by Android applications.</dd>
-
- <dt><a href="{@docRoot}reference/traceview.html" >Traceview</a></dt>
- <dd> This tool produces graphical analysis views of trace log data that you
- can generate from your Android application. </dd>
-
- <dt><a href="{@docRoot}reference/othertools.html#mksdcard">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="{@docRoot}reference/othertools.html#dx">dx</a></dt>
- <dd>The dx tool rewrites .class bytecode into Android bytecode
- (stored in .dex files.)</dd>
-
- <dt><a href="{@docRoot}reference/monkey.html" >UI/Application
- Exerciser Monkey</a></dt>
- <dd>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.</dd>
-
- <dt><a href="{@docRoot}reference/othertools.html#activitycreator">activitycreator</a></dt>
- <dd>A script that generates <a
- href="http://ant.apache.org/" title="Ant">Ant</a> build files that
- you can use to compile your Android applications. If you are developing
- on Eclipse with the ADT plugin, you won't need to use this script. </dd>
-</dl>
-
diff --git a/docs/html/guide/developing/tools/adb.jd b/docs/html/guide/developing/tools/adb.jd
index 25b5e29..50fb024 100644
--- a/docs/html/guide/developing/tools/adb.jd
+++ b/docs/html/guide/developing/tools/adb.jd
@@ -1,14 +1,45 @@
page.title=Android Debug Bridge
@jd:body
-<p>Android Debug Bridge (adb) is a versatile tool that lets you manage the state of a device or <a href="{@docRoot}reference/emulator.html">emulator</a>. </p>
+<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 tool that </a>. </p>
<p>Some of ways you can use adb include:</p>
<ul>
-<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>
<p>The sections below introduce adb and describe many of its common uses. </p>
@@ -39,8 +70,8 @@ page.title=Android Debug Bridge
<a name="overview"></a>
<h2>Overview</h2>
-
-<p>The adb tool is a client-server program that includes three components: </p>
+-->
+<p>Android Debug Bridge (adb) is a versatile tool lets you manage the state of an emulator instance or 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>
@@ -138,7 +169,7 @@ emulator-5558&nbsp;&nbsp;device</pre>
<pre>adb install &lt;path_to_apk&gt;</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}reference/aapt.html">Android Asset Packaging Tool</a> (aapt). </p>
+<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/tools/aapt.html">Android Asset Packaging Tool</a> (aapt). </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>
@@ -409,7 +440,7 @@ 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}reference/monkey.html" title="monkey">UI/Application Exerciser Monkey</a> documentation page.</p>
+<a href="{@docRoot}guide/developing/tools/monkey.html" title="monkey">UI/Application Exerciser Monkey</a> documentation page.</p>
<a name="othershellcommands"></a>
@@ -432,7 +463,7 @@ application and send 500 pseudo-random events to it.</p>
<tr>
<td><code>dumpsys</code></td>
<td>Dumps system data to the screen.</td>
-<td rowspan=4">The <a href="{@docRoot}reference/ddms.html">Dalvik Debug Monitor Service</a> (DDMS) tool offers integrated debug environment that you may find easier to use.</td>
+<td rowspan=4">The <a href="{@docRoot}guide/developing/tools/ddms.html">Dalvik Debug Monitor Service</a> (DDMS) tool offers integrated debug environment that you may find easier to use.</td>
</tr>
<tr>
diff --git a/docs/html/guide/developing/tools/adt.jd b/docs/html/guide/developing/tools/adt.jd
new file mode 100644
index 0000000..c3bd255
--- /dev/null
+++ b/docs/html/guide/developing/tools/adt.jd
@@ -0,0 +1,154 @@
+page.title=ADT Plugin
+@jd:body
+
+<p>The Android Development Tools (ADT) plugin adds powerful extensions to the Eclipse integrated development environment. It allows you to create and debug your Android applications easier and faster. If you use Eclipse, the ADT plugin gives you an incredible boost in developing Android applications:</p>
+
+<ul>
+ <li>It gives you access to other Android development tools from inside the Eclipse IDE. For example, ADT lets you access the many capabilities of the DDMS tool: take screenshots, manage port-forwarding, set breakpoints, and view thread and process informationd irectly from Eclipse.</li>
+ <li>It provides a New Project Wizard, which helps you quickly create and set up all of the basic files you'll need for a new Android application.</li>
+ <li>It automates and simplifies the process of building your Android application.</li>
+ <li>It provides an Android code editor that helps you write valid XML for your Android manifest and resource files.</li>
+</ul>
+
+<h2 id="installingplugin">Installing the Eclipse Plugin (ADT)</h2>
+
+<p>If you <em>will not</em> be using the Eclipse IDE, you do not need to download or install the ADT plugin.</p>
+
+<p>To download and install the ADT plugin, follow the steps below for your respective Eclipse version. </p>
+
+<table style="font-size:100%">
+<tr><th>Eclipse 3.3 (Europa)</th><th>Eclipse 3.4 (Ganymede)</th></tr>
+<tr>
+<td width="50%">
+<ol>
+ <li>Start Eclipse, then select <strong>Help</strong> &gt; <strong>Software Updates</strong> &gt; <strong>Find
+ and Install...</strong>. </li>
+
+ <li>In the dialog that appears, select <strong>Search for new features to install</strong> and click <strong>Next</strong>. </li>
+ <li>Click <strong>New Remote Site</strong>. </li>
+ <li>In the resulting dialog box, enter a name for the remote site (e.g. Android Plugin) and enter this as its URL:
+ <pre>https://dl-ssl.google.com/android/eclipse/</pre>
+ <p>Click <strong>OK</strong>.</p> </li>
+ <li>You should now see the new site added to the search list (and checked).
+ Click <strong>Finish</strong>. </li>
+ <li>In the subsequent Search Results dialog box, select the checkbox for
+ <strong>Android Plugin</strong> &gt; <strong>Developer Tools</strong>.
+ This will check both features: "Android Developer Tools", and "Android
+ Editors". The Android Editors feature is optional, but recommended. If
+ you choose to install it, you need the WST plugin mentioned earlier in this
+ page. Click <strong>Next</strong>. </li>
+ <li>Read the license agreement and then select <strong>Accept terms of the license agreement</strong>.
+ Click <strong>Next</strong>. </li>
+ <li>Click <strong>Finish</strong>. </li>
+
+ <li>The ADT plugin is not signed; you can accept the installation anyway
+ by clicking <strong>Install All</strong>. </li>
+ <li>Restart Eclipse. </li>
+</ol>
+
+</td>
+<td>
+
+<ol>
+ <li>Start Eclipse, then select <strong>Help</strong> &gt; <strong>Software Updates...</strong>.
+ </li>
+ <li>In the dialog that appears, click the <strong>Available Software</strong> tab.
+ </li>
+ <li>Click <strong>Add Site...</strong>
+ </li>
+ <li>Enter this as the Location:
+ <pre>https://dl-ssl.google.com/android/eclipse/</pre>
+ <p>Click <strong>OK</strong>.</p></li>
+ <li>Back in the Available Software view, you should see the plugin. Select the checkbox next to
+ <em>Developer Tools</em> and click <strong>Install...</strong>
+ </li>
+ <li>On the subsequent Install window, "Android Developer Tools", and "Android Editors" should both be checked.
+ The Android Editors feature is optional, but recommended. If
+ you choose to install it, you need the WST plugin mentioned earlier in this
+ page. Click <strong>Next</strong>.
+ </li>
+ <li>Accept the license agreement and click <strong>Finish</strong>.</li>
+ <li>Restart Eclipse. </li>
+</ol>
+
+</td>
+</tr>
+</table>
+
+<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>In Step 4, try changing the remote update site URL to use <code>http</code>, rather than <code>https</code>. </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 3.3/3.4, you can configure proxy information from the main
+ Eclipse menu in <strong>Window</strong> (on Mac, <strong>Eclipse</strong>) &gt; <strong>Preferences</strong> &gt; <strong>General</strong> &gt; <strong>Network Connections</strong>.</li>
+</ul>
+<p>
+If you are still unable to use Eclipse to download the ADT plugin, follow these steps to download and install the plugin from your computer:
+</p>
+<ol>
+<li><a href="adt_download.html">Download the ADT zip file</a> (do not unpack it).
+<li>Follow steps 1 and 2 in the default install instructions (above).
+<li>In Eclipse 3.3, click <strong>New Archive Site...</strong>. <br/>
+ In Eclipse 3.4, click <strong>Add Site...</strong>, then <strong>Archive...</strong>
+<li>Browse and select the downloaded the zip file.
+<li>Follow the remaining procedures, above, starting from steps 5.
+</ol>
+<p>
+Note that to update your plugin, you will have to follow these steps again instead of the default update instructions.</p>
+
+<p>Note that the "Android Editors" feature of ADT requires several optional
+Eclipse components (for example, WST). If you encounter an error when
+installing ADT, your Eclipse installion might not include those components.
+For information about how to quickly add the necessary components to your
+Eclipse installation, see the troubleshooting topic
+<a href="{@docRoot}guide/appendix/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>
+
+<a name="Updating_the_ADT_plugin" id="Updating_the_ADT_plugin"></a>
+
+<h2>Updating the ADT Plugin </h2>
+
+<p>In some cases, a new ADT plugin may become available for your existing version of the SDK. You can use the steps below to update
+the ADT plugin from inside Eclipse. </p>
+
+<table style="font-size:100%">
+<tr><th>Eclipse 3.3 (Europa)</th><th>Eclipse 3.4 (Ganymede)</th></tr>
+<tr>
+<td width="50%">
+<ol>
+ <li> Select <strong>Help</strong> &gt; <strong>Software Updates</strong> &gt; <strong>Find and Install...</strong>. </li>
+ <li> Select <strong>Search for updates of the currently installed features</strong> and click <strong>Finish</strong>. </li>
+ <li> If an update for ADT is available, select and install. </li>
+</ol>
+
+<p> Alternatively, </p>
+<ol>
+ <li> Select <strong>Help</strong> &gt; <strong>Software Updates</strong> &gt; <strong>Manage Configuration</strong>. </li>
+ <li> Navigate down the tree and select <strong>Android Development Tools &lt;version&gt;</strong> </li>
+ <li> Select <strong>Scan for Updates</strong> under <strong>Available Tasks</strong>.</li>
+</ol>
+</td>
+<td>
+<ol>
+ <li>Select <strong>Help</strong> &gt; <strong>Software Updates...</strong></li>
+ <li>Select the <strong>Installed Software</strong> tab.</li>
+ <li>Click <strong>Update...</strong></li>
+ <li>If an update for ADT is available, select it and click <strong>Finish</strong>.</li>
+</ol>
+</td>
+</tr>
+</table>
diff --git a/docs/html/guide/developing/tools/adt_download.jd b/docs/html/guide/developing/tools/adt_download.jd
new file mode 100644
index 0000000..f03cc46
--- /dev/null
+++ b/docs/html/guide/developing/tools/adt_download.jd
@@ -0,0 +1,65 @@
+page.title=Download the ADT Plugin Zip File
+@jd:body
+
+<p>
+If you are unable to download the ADT plugin through <a
+href="{@docRoot}guide/developing/tools/adt.html#installingplugin">setting up a remote
+update site</a> in Eclipse, you can download the ADT zip file and install it
+from your computer (archived site) instead.
+</p>
+<p>
+If you go with this method, in order to update the plugin, you will need to
+download the latest version from this page, uninstall the old version from
+Eclipse, then install the new version. For more details on the procedure,
+see Troubleshooting ADT Installation in the
+<a href="{@docRoot}guide/developing/tools/adt.html#troubleshooting"> installation
+page</a>.
+</p>
+<p>
+<table>
+ <tr>
+ <th>Version</th>
+ <th>File</th>
+ <th>Date</th>
+ <th>Compatible SDK Versions</th>
+ <th>Notes</th>
+ </tr>
+
+ <tr>
+ <td style="background-color:#ffcccc;">0.8.0</td>
+ <td style="background-color:#ffcccc;"><a href="http://dl-ssl.google.com/android/ADT-0.8.0.zip">ADT-0.8.0.zip</a></td>
+ <td style="background-color:#ffcccc;">23&nbsp;September&nbsp;2008</td>
+ <td style="background-color:#ffcccc;">Android&nbsp;1.0&nbsp;SDK,&nbsp;Release&nbsp;1</td>
+ <td style="background-color:#ffcccc;">Required for users of Android 1.0 SDK, Release&nbsp;1. </td>
+ </tr>
+ <tr>
+ <td>0.7.1</td>
+ <td><a href="http://dl-ssl.google.com/android/ADT-0.7.1.zip">ADT-0.7.1.zip</a></td>
+ <td>18 Aug 2008</td>
+ <td>Android 0.9 SDK beta</td>
+ <td>Required for users of Android 0.9 SDK beta. As of this version, <b>Eclipse 3.2 is no longer supported.</b>
+ Please upgrade to Eclipse Ganymede (3.4) or Europa (3.3) if you are still using 3.2. </td>
+ </tr>
+ <tr>
+ <td>0.4.0</td>
+ <td><a href="http://dl-ssl.google.com/android/ADT-0.4.0.zip">ADT-0.4.0.zip</a></td>
+ <td>12 Feb 2008</td>
+ <td>m5-rc14</td>
+ <td>Required if you are using the M5 SDK. See the SDK Release Notes for details on changes and enhancements in this version.</td>
+ </tr>
+ <tr>
+ <td>0.3.3</td>
+ <td><a href="http://dl-ssl.google.com/android/ADT-0.3.3.zip">ADT-0.3.3.zip</a></td>
+ <td>14 Dec 2007</td>
+ <td>m3-rc37</td>
+ <td>Some significant enhancements (see SDK Release Notes).</td>
+ </tr>
+ <tr>
+ <td>0.3.1</td>
+ <td><a href="http://dl-ssl.google.com/android/ADT-0.3.1.zip">ADT-0.3.1.zip</a></td>
+ <td>21 Nov 2007</td>
+ <td>m3-rc20, m3-rc22</td>
+ <td>Initial Release.</td>
+ </tr>
+</table>
+</p>
diff --git a/docs/html/guide/developing/tools/aidl.jd b/docs/html/guide/developing/tools/aidl.jd
index 145fd93..96e4fec 100755..100644
--- a/docs/html/guide/developing/tools/aidl.jd
+++ b/docs/html/guide/developing/tools/aidl.jd
@@ -31,8 +31,8 @@ generate code to marshall the parameters.</p>
<li><strong><a href="#aidlsyntax">Create your .aidl file</a> </strong>- This
file defines an interface (<em>YourInterface</em>.aidl) that defines the
methods and fields available to a client. </li>
- <li><strong>Add the .aidl file to your makefile</strong> - (the <a href="{@docRoot}intro/installing.html#developingwitheclipse">Eclipse
- plugin</a> manages this for you). Android includes the compiler, called
+ <li><strong>Add the .aidl file to your makefile</strong> - (the ADT Plugin for Eclipse
+ manages this for you). Android includes the compiler, called
AIDL, in the <code>tools/</code> directory. </li>
<li><strong><a href="#implementtheinterface">Implement your interface methods</a></strong> -
The AIDL compiler creates an interface in the Java programming language from your AIDL interface.
@@ -161,7 +161,8 @@ private final IRemoteService.Stub mBinder = new IRemoteService.Stub(){
interface to clients. </p>
<pre>public class RemoteService extends Service {
...
-{@include development/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.java exposing_a_service}
+{@include development/samples/ApiDemos/src/com/example/android/apis/app/RemoteService.java
+ exposing_a_service}
}</pre>
<a name="parcelable"></a>
@@ -265,7 +266,7 @@ to a Parcel.</p>
other processes. In this case, the rect will read four numbers from the 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}devel/security.html">Security and Permissions in Android</a> for more
+<a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a> for more
on how to keep your application secure from malware.</p>
<h2>Calling an IPC Method <a name="calling"></a></h2>
diff --git a/docs/html/guide/developing/tools/ddms.jd b/docs/html/guide/developing/tools/ddms.jd
index 79ae66a..fa04216 100644
--- a/docs/html/guide/developing/tools/ddms.jd
+++ b/docs/html/guide/developing/tools/ddms.jd
@@ -19,7 +19,7 @@ the device. On Android, every application runs in its own process,
each of which hosts its own virtual machine (VM). And each process
listens for a debugger on a different port.</p>
-<p>When it starts, DDMS connects to <a href="{@docRoot}reference/adb.html">adb</a> and
+<p>When it starts, DDMS connects to <a href="{@docRoot}guide/developing/tools/adb.html">adb</a> and
starts a device monitoring service between the two, which will notify DDMS when a device is
connected or disconnected. When a device is connected, a VM monitoring service is created
between adb and DDMS, which will notify DDMS when a VM on the device is started
@@ -32,7 +32,7 @@ DDMS can now talk to the VM using a custom wire protocol.</p>
<p>DDMS also opens another local port, the DDMS "base port" (8700, by default), upon which it also listens for a debugger. When a debugger connects to this base port, all traffic is forwarded to the VM currently selected in DDMS, so this is typically where you debugger should connect.</p>
<p>For more information on port-forwarding with DDMS,
-read <a href="{@docRoot}intro/installing.html#eclipse">Configuring your IDE to attach
+read <a href="{@docRoot}guide/developing/debug-tasks.html#ide-debug-port">Configuring your IDE to attach
to port 8700 for debugging</a>.</p>
<p class="note"><strong>Tip:</strong>
@@ -58,7 +58,7 @@ cursor may jump to the last line in the method for one step.</p>
currently selected VM. (Notice, as you select a VM in the list, the listed port includes 8700.)
This way, there's no need to reconfigure the debugger's port each time you switch between VMs.</p>
<p>When an application running on the device calls {@link android.os.Debug#waitForDebugger()}
- (or you select this option in the <a href="{@docRoot}intro/installing.html#additionaldebugging">developer
+ (or you select this option in the <a href="{@docRoot}guide/developing/debug-tasks.html#additionaldebugging">developer
options</a>), a red icon will be shown next to the client name, while it waits for the
debugger to attach to the VM. When a debugger is connected, the icon will turn green. </p>
<p>If you see a crossed-out bug icon, this means that the DDMS was unable to complete a
@@ -181,8 +181,8 @@ From here, you can:</p>
Future releases may support timed placement and routes within a single coordinate element.</p>
</li>
</ul>
- <p>For <em>additional</em> methods of spoofing location-based data, see the
- <a href="{@docRoot}toolbox/apis/lbs.html">Location-based Service APIs</a> document.</p>
+ <p>For <em>additional</em> methods of setting up mocks of location-based data, see the
+ <a href="{@docRoot}guide/topics/location/index.html">Location</a> topic.</p>
</li>
</ul>
@@ -192,7 +192,7 @@ From here, you can:</p>
<h2 id="file-explorer">File Explorer</h2>
<p>With the File Explorer, you can view the device file system and perform basic management,
-like pushing and pulling files. This circumvents using the <a href="{@docRoot}reference/adb.html">adb</a>
+like pushing and pulling files. This circumvents using the <a href="{@docRoot}guide/developing/tools/adb.html">adb</a>
<code>push</code> and <code>pull</code> commands, with a GUI experience.</p>
<p>With DDMS open, select <strong>Device</strong> > <strong>File Explorer...</strong> to open the
File Explorer window. You can drag-and-drop into the device directories, but cannot drag <em>out</em> of them.
@@ -210,7 +210,7 @@ sdcard directory. However, your files may not appear automatically. For example,
MP3 file to the sdcard, the media player won't see them until you restart the emulator. (When restarting
the emulator from command line, be sure to mount the sdcard again.)</p>
<p>For more information on creating an SD card image, see the
-<a href="{@docRoot}/reference/othertools.html#mksdcard">Other Tools</a> document.</p>
+<a href="{@docRoot}guide/developing/tools/othertools.html#mksdcard">Other Tools</a> document.</p>
<h2 id="screen-capture">Screen Capture</h2>
<p>You can capture screen images on the device or emulator by selecting <strong>Device</strong>
@@ -234,7 +234,7 @@ the emulator from command line, be sure to mount the sdcard again.)</p>
<h2 id="examine-radio-state">Examine Radio State</h2>
<p>By default, radio state is not output during a standard logcat (it is a lot of
information). To see radio information, either click <strong>Device</strong> &gt; <strong>Dump radio
- state...</strong> or run logcat as described in <a href="{@docRoot}intro/installing.html#logradio">Logging
+ state...</strong> or run logcat as described in <a href="{@docRoot}guide/developing/debug-tasks.html#logradio">Logging
Radio Information</a>. </p>
<h2 id="stop-a-vitrual-machine">Stop a Virtual Machine </h2>
diff --git a/docs/html/guide/developing/tools/draw9patch.jd b/docs/html/guide/developing/tools/draw9patch.jd
index 25604f8..f25fabb 100644
--- a/docs/html/guide/developing/tools/draw9patch.jd
+++ b/docs/html/guide/developing/tools/draw9patch.jd
@@ -3,13 +3,12 @@ page.title=Draw 9-patch
<p>The Draw 9-patch tool allows you to easily create a
{@link android.graphics.NinePatch} graphic using a WYSIWYG editor.</p>
-<p>To learn more about what a Nine-patch graphic is, and how they work, please read
+<p>For an introduction to Nine-patch graphics and how they work, please read
the section on Nine-patch in the
-<a href="{@docRoot}reference/available-resources.html#ninepatch">Available Resource
-Types</a> document.</p>
+<a href="{@docRoot}guide/topics/resources/available-resources.html#ninepatch">Ninepatch Images</a> topic.</p>
<div class="sidebox" style="width:auto"><br/>
-<img src="/android/images/draw9patch-norm.png" alt="" height="300" width="341" />
+<img src="{@docRoot}images/draw9patch-norm.png" alt="" height="300" width="341" />
</div>
<p>Here's a quick guide to create a Nine-patch graphic using the Draw 9-patch tool.
@@ -41,7 +40,7 @@ You'll need the PNG image with which you'd like to create a NinePatch.</p>
with no drawing area added, because it already exists.</p>
<div class="sidebox" style="width:auto"><br/>
-<img src="/android/images/draw9patch-bad.png" alt="" height="300" width="341" />
+<img src="{@docRoot}images/draw9patch-bad.png" alt="" height="300" width="341" />
</div>
<p>Optional controls include:</p>
@@ -57,5 +56,3 @@ You'll need the PNG image with which you'd like to create a NinePatch.</p>
produce artifacts in the graphic when stretched. Visual coherence of your stretched
image will be maintained if you eliminate all bad patches.</li>
<ul>
-
-<p><strong><a href="/android/intro/tools.html">Back to Development Tools</a></strong></p> \ No newline at end of file
diff --git a/docs/html/guide/developing/tools/emulator.jd b/docs/html/guide/developing/tools/emulator.jd
index 0516fdd..dd367b7 100755..100644
--- a/docs/html/guide/developing/tools/emulator.jd
+++ b/docs/html/guide/developing/tools/emulator.jd
@@ -1,7 +1,7 @@
page.title=Android Emulator
@jd:body
-<img src="{@docRoot}images/emulator-hvga-p.png" alt="Image of the Android Emulator" width="271" height="524" style="margin-left:0em;float:right;"/>
+<img src="{@docRoot}images/emulator-hvga-p.png" alt="Image of the Android Emulator" width="271" height="524" style="margin-left:0em;margin-top:-4em;float:right;"/>
<p>The Android SDK includes a mobile device emulator -- a virtual mobile device
that runs on your computer. The emulator lets you prototype, develop, and test
@@ -25,56 +25,64 @@ arriving SMS messages or phone calls), and simulate latency effects and dropouts
on the data channel.</p>
-<h2 style="clear:right;">Contents</h2>
-
-<div class="g-section g-tpl-50-50">
-<div class="g-unit g-first">
-
-<dl>
-<dt><a href="#overview">Overview</a></dt>
-<dt><a href="#starting">Starting and Stopping the Emulator</a></dt>
-<dt><a href="#controlling">Controlling the Emulator</a></dt>
-<dt><a href="#startup-options">Emulator Startup Options</a></dt>
-<dt><a href="#diskimages">Working with Emulator Disk Images</a></dt>
- <dd><a href="#systemimages">System Images</a></dd>
- <dd><a href="#runtimeimages">Runtime Images: User Data and SD Card</a></dd>
- <dd><a href="#temporaryimages">Temporary Images</a></dd>
-<dt><a href="#emulatornetworking">Emulator Networking</a></dt>
- <dd><a href="#networkaddresses">Network Address Space</a></dd>
- <dd><a href="#networkinglimitations">Local Networking Limitations</a></dd>
- <dd><a href="#redirections">Using Network Redirections</a></dd>
- <dd><a href="#dns">Configuring the Emulator's DNS Settings</a></dd>
- <dd><a href="#proxy">Using the Emulator with a Proxy</a></dd>
- <dd><a href="#connecting">Interconnecting Emulator Instances</a></dd>
- <dd><a href="#calling">Sending a Voice Call or SMS to Another Emulator Instance</a></dd>
-</dl>
+
+
+<div class="inline-toc" style="whitespace:nowrap;">
+<h4>In this document:</h4>
+<div class="g-unit g-first" style="whitespace:nowrap;width:35%;">
+<ol class="toc">
+<li><a href="#overview">Overview</a></li>
+<li><a href="#starting">Starting and Stopping the Emulator</a></li>
+<li><a href="#controlling">Controlling the Emulator</a></li>
+<li><a href="#startup-options">Emulator Startup Options</a></li>
+<li><a href="#diskimages">Working with Emulator Disk Images</a>
+ <ol class="toc">
+ <li><a href="#systemimages">System Images</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 class="toc">
+ <li><a href="#networkaddresses">Network Address Space</a></li>
+ <li><a href="#networkinglimitations">Local Networking Limitations</a></li>
+ <li><a href="#redirections">Using Network Redirections</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>
+</ol>
</div>
-<div class="g-unit">
-<dl>
-<dt><a href="#console">Using the Emulator Console</a></dt>
- <dd><a href="#portredirection">Port Redirections</a></dd>
- <dd><a href="#geo">Geo Location Provider Emulation</a></dd>
- <dd><a href="#events">Sending Events</a></dd>
- <dd><a href="#power">Emulating Device Power Characteristics</a></dd>
- <dd><a href="#netstatus">Network Status</a></dd>
- <dd><a href="#netdelay">Network Delay Emulation</a></dd>
- <dd><a href="#netspeed">Network Speed Emulation</a></dd>
- <dd><a href="#telephony">Telephony Emulation</a></dd>
- <dd><a href="#sms">SMS Emulation</a></dd>
- <dd><a href="#vm">VM State</a></dd>
- <dd><a href="#window">Emulator Window</a></dd>
- <dd><a href="#terminating">Terminating an Emulator Instance</a></dd>
-<dt><a href="#skins">Using Emulator Skins</a></dt>
-<dt><a href="#multipleinstances">Running Multiple Instances of the Emulator</a></dt>
-<dt><a href="#apps">Installing Applications on the Emulator</a></dt>
-<dt><a href="#sdcard">SD Card Emulation</a></dt>
- <dd><a href="#creating">Creating a Disk Image</a></dd>
- <dd><a href="#copying">Copying Files to a Disk Image</a></dd>
- <dd><a href="#loading">Loading the Disk Image at Emulator Startup</a></dd>
-<dt><a href="#troubleshooting">Troubleshooting Emulator Problems</a></dt>
-<dt><a href="#limitations">Emulator Limitations</a></dt>
-</dl>
+<div class="g-unit" style="whitespace:nowrap;">
+<ol class="toc">
+<li><a href="#console">Using the Emulator Console</a>
+ <ol class="toc">
+ <li><a href="#portredirection">Port Redirections</a></li>
+ <li><a href="#geo">Geo Location Provider Emulation</a></li>
+ <li><a href="#events">Sending Events</a></li>
+ <li><a href="#power">Emulating 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="#skins">Using Emulator Skins</a></li>
+<li><a href="#multipleinstances">Running Multiple Instances of the Emulator</a></li>
+<li><a href="#apps">Installing Applications on the Emulator</a></li>
+<li><a href="#sdcard">SD Card Emulation</a>
+ <ol class="toc">
+ <li><a href="#creating">Creating a Disk Image</a></li>
+ <li><a href="#copying">Copying Files to a Disk Image</a></li>
+ <li><a href="#loading">Loading the Disk Image at Emulator Startup</a></li>
+ </ol></li>
+<li><a href="#troubleshooting">Troubleshooting Emulator Problems</a></li>
+<li><a href="#limitations">Emulator Limitations</a></li>
+</ol>
</div>
</div>
@@ -209,7 +217,7 @@ the keys of your keyboard. </p>
</tr>
<tr>
<td>Audio volume up button</td>
- <td>KEYPAD_PLUS, Ctrl-F5</td>
+ <td>KEYPAD_PLUS, Ctrl-5</td>
</tr>
<tr>
@@ -242,7 +250,11 @@ the keys of your keyboard. </p>
</tr>
<tr>
<td>Toggle trackball mode</td>
- <td>Ctrl-T</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>
@@ -333,8 +345,8 @@ Here's the command-line usage for launching the emulator with options: </p>
<td>Use &lt;filepath&gt; 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 &quot;userdata-qemu.img&quot;
- in the directory specified in &lt;datadir&gt;. ~/.android (on Linux/Mac) or
- C:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Android (on Windows).
+ in the directory specified in &lt;datadir&gt;. ~/.android/SDK-1.0 (on Linux/Mac) or
+ C:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Android\SDK-1.0 (on Windows).
<p> If you use <code>-data &lt;filepath&gt;</code> but the file does not exist, the emulator creates
a file at that location using the specified name. </p>
<p>See <a href="#multipleinstances">Running Multiple Emulator Instances</a> for information about how
@@ -348,8 +360,8 @@ Here's the command-line usage for launching the emulator with options: </p>
<td><code>&lt;dir&gt;</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
- directory ~/.android (on Linux/Mac) or C:\Documents and Settings\&lt;user&gt;\Local Settings\Application
- Data\Android (on Windows). </p><p>For more information on disk images, use <code>-help-disk-images</code>.</p>
+ directory ~/.android/SDK-1.0 (on Linux/Mac) or C:\Documents and Settings\&lt;user&gt;\Local Settings\Application
+ Data\Android\SDK-1.0 (on Windows). </p><p>For more information on disk images, use <code>-help-disk-images</code>.</p>
</td></tr>
-->
<tr>
@@ -776,8 +788,8 @@ described above. The emulator stores the default image in this location on
on your development machine: </p>
<ul>
- <li>Linux and OS X: <code>~/.android</code></li>
- <li>Windows: <code>C:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Android</code></li>
+ <li>Linux and OS X: <code>~/.android/SDK-1.0</code></li>
+ <li>Windows: <code>C:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Android\SDK-1.0</code></li>
</ul>
<!--
@@ -1034,7 +1046,7 @@ case, <code>redir</code> generates an error message to that effect. </p>
<p>The Android Debug Bridge (ADB) tool provides port forwarding, an alternate
way for you to set up network redirections. For more information, see <a
-href="{@docRoot}reference/adb.html#forwardports">Forwarding Ports</a> in the ADB
+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,
@@ -1159,7 +1171,7 @@ B:10.0.2.15:&lt;serverPort&gt;</code></li>
<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}reference/adb.html#devicestatus">Querying for Emulator/Device Instances</a> in the adb documentation.</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>
@@ -1233,7 +1245,7 @@ B:10.0.2.15:&lt;serverPort&gt;</code></li>
</tr>
</table>
-<p>You can issue the <code>geo</code> command to fix the GPS location as soon as an emulator instance is running. The emulator creates a mock location provider that sends the location to GPS-aware applications as soon as they start and register location listeners. Any application can query the location manager to obtain the current GPS fix for the emulated device by calling:
+<p>You can issue the <code>geo</code> command to fix the GPS location as soon as an emulator instance is running. The emulator creates a mock location provider that sends it to GPS-aware applications as soon as they start and register location listeners. Any application can query the location manager to obtain the current GPS fix for the emulated device by calling:
<pre>LocationManager.getLastKnownLocation("gps")</pre>
@@ -1443,7 +1455,7 @@ kilobits/sec):</p>
<tr>
<td><code>call &lt;phonenumber&gt;</code></td>
<td>Simulate an inbound phone call from &lt;phonenumber&gt;.</td>
- <td>See also <a href="#calling">Sending a Voice Call or SMS to another Emulator Instance</a>.</td>
+ <td>&nbsp;</td>
</tr>
<tr>
<td><code>accept &lt;phonenumber&gt;</code></td>
@@ -1632,8 +1644,8 @@ kilobits/sec):</p>
<ul>
<li>By default, only the first-launched emulator instance can preserve user data across sessions. When a session closes,
the emulator stores the user data to a user-data image file &mdash; by default, it stores the data in the file
- <code>~/.android/userdata-qemu.img </code>(on Linux and Mac) or <code>C:\Documents and Settings\&lt;user&gt;\Local
- Settings\Application Data\Android\userdata-qemu.img</code> (on Windows) in your development computer.</li>
+ <code>~/.android/SDK-1.0/userdata-qemu.img </code>(on Linux and Mac) or <code>C:\Documents and Settings\&lt;user&gt;\Local
+ Settings\Application Data\Android\SDK-1.0\userdata-qemu.img</code> (on Windows) in your development computer.</li>
<li>Emulator instances that you start after the first instance (that are running concurrently) can also store user data during a session, but they <em>do not</em> preserve it for the next session, unless you have specified a unique user-data image file in which the data should be stored. </li>
@@ -1646,9 +1658,9 @@ kilobits/sec):</p>
<h2>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 <a href="{@docRoot}reference/adb.html#move">using
+your application on the emulator <a href="{@docRoot}guide/developing/tools/adb.html#move">using
the adb utility</a>. Before installing the application, you need to package it
-in a .apk file using the <a href="aapt.html">Android Asset Packaging Tool</a>.
+in a .apk file using the <a href="{@docRoot}guide/developing/tools/aapt.html">Android Asset Packaging Tool</a>.
Once the application is installed, you can start the emulator from the command
line, as described in this document, using any startup options necessary.
When the emulator is running, you can also connect to the emulator instance's
@@ -1683,7 +1695,7 @@ see <a href="#diskimages">Working with Emulator Disk Images</a>.</p>
<pre>mksdcard 1024M sdcard1.iso</pre>
-<p>For more information, see <a href="{@docRoot}reference/othertools.html">Other Tools</a>. </p>
+<p>For more information, see <a href="{@docRoot}guide/developing/tools/othertools.html">Other Tools</a>. </p>
<a name="copying"></a>
<h3>Copying Files to a Disk Image</h3>
@@ -1702,12 +1714,12 @@ see <a href="#diskimages">Working with Emulator Disk Images</a>.</p>
<h2>Troubleshooting Emulator Problems</h2>
-<p>The adb utility sees the emulator as an actual physical device. For this reason, you might have to use the -d flag with some common adb commands, such as <code>install</code>. The -d flag lets you specify which of several connected devices to use as the target of a command. If you don't specify -d, the emulator will target the first device in its list. For more information about adb, see <a href="{@docRoot}reference/adb.html">Android Debug Bridge</a>.</p>
+<p>The adb utility sees the emulator as an actual physical device. For this reason, you might have to use the -d flag with some common adb commands, such as <code>install</code>. The -d flag lets you specify which of several connected devices to use as the target of a command. If you don't specify -d, the emulator will target the first device in its list. For more information about 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 &quot;Warning: No DNS servers found&quot; 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}kb/index.html">Frequently Asked Questions</a> for more troubleshooting information. </p>
+<p>See <a href="{@docRoot}guide/appendix/faq/index.html">Frequently Asked Questions</a> for more troubleshooting information. </p>
<a name="limitations"></a>
<h2>Emulator Limitations</h2>
diff --git a/docs/html/guide/developing/tools/hierarchy-viewer.jd b/docs/html/guide/developing/tools/hierarchy-viewer.jd
index 065211c..431008c 100644
--- a/docs/html/guide/developing/tools/hierarchy-viewer.jd
+++ b/docs/html/guide/developing/tools/hierarchy-viewer.jd
@@ -35,7 +35,7 @@ to refresh the list of available windows on the right.</p>
<li>Wire-frame View: a wire-frame drawing of the layout, on the bottom-right.</li>
</ul>
<br/>
-<img src="/android/images/hierarchyviewer-layout.png" alt="" height="509" width="700" />
+<img src="{@docRoot}images/hierarchyviewer-layout.png" alt="" height="509" width="700" />
<p>Select a node in the Tree View to display the properties of that element in
the Properties View. When a node is selected, the Wire-frame View
@@ -66,7 +66,7 @@ You must reload the Layout View by clicking <strong>Load View Hierarchy</strong>
<li>Loupe View: a magnified, pixel-grid view of the device window, on the right.</li>
</ul>
<br/>
-<img src="/android/images/hierarchyviewer-pixelperfect.png" alt="" height="509" width="700" />
+<img src="{@docRoot}images/hierarchyviewer-pixelperfect.png" alt="" height="509" width="700" />
<p>Click on an element in the Explorer View and a "layout box" will be drawn in the
Normal View to indicate the layout position of that element. The layout box uses multiple rectangles, to indicate the normal bounds, the padding and the margin (as needed). The purple or green rectangle indicates
@@ -95,5 +95,4 @@ in the Normal View, because the hierarchy believes you are still focused on the
<li><strong>Zoom</strong>: Adjust the zoom level of the Loupe View.</li>
</ul>
-<p><strong><a href="/android/intro/tools.html">Back to Development Tools</a></strong></p>
diff --git a/docs/html/guide/developing/tools/index.jd b/docs/html/guide/developing/tools/index.jd
index c38f6c5..b491a4f 100644
--- a/docs/html/guide/developing/tools/index.jd
+++ b/docs/html/guide/developing/tools/index.jd
@@ -1,7 +1,7 @@
page.title=Tools Overview
@jd:body
-<img src="{@docRoot}images/android_icon_125.png" alt="android_robot" align="right" width="125" height="137"">
+<img src="{@docRoot}assets/images/android_wrench.png" alt="" align="right">
<p>The Android SDK includes a variety of custom tools that help you develop mobile
applications on the Android platform. The most important of these are the Android
@@ -10,51 +10,29 @@ includes a variety of other tools for debugging, packaging, and installing your
applications on the emulator. </p>
<dl>
- <dt><a href="{@docRoot}emulator.html">Android Emulator</a></dt>
+ <dt><a href="emulator.html">Android Emulator</a></dt>
<dd>A virtual mobile device that runs on your computer. You use the emulator to design,
debug, and test your applications in an actual Android run-time environment. </dd>
- <dt><a href="{@docRoot}hierarchy-viewer.html">Hierarchy Viewer</a>
- <sup class="new">New!</sup></dt></dt>
- <dd>The Hierarchy Viewer tool allows you to debug and optimize your user interface.
- It provides a visual representation of your layout's hierarchy of Views and a magnified inspector
- of the current display with a pixel grid, so you can get your layout just right.
- </dd>
-
- <dt><a href="{@docRoot}draw9patch.html">Draw 9-patch</a>
- <sup class="new">New!</sup></dt>
- <dd>The Draw 9-patch tool 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="adt.html">Android Development Tools Plugin</a> (for the Eclipse IDE)</dt>
+ <dd>The ADT plugin adds powerful extensions to the Eclipse integrated environment,
+ making creating and debugging your Android applications easier and faster. If you
+ use Eclipse, the ADT plugin gives you an incredible boost in developing Android
+ applications.</dd>
- <dt>Android
- Development Tools Plugin</a> for the Eclipse IDE</dt>
- <dd>The ADT plugin adds powerful extensions to the Eclipse integrated environment,
- making creating and debugging your Android applications easier and faster. If you
- use Eclipse, the ADT plugin gives you an incredible boost in developing Android
- applications:
- </dd>
-
- <ul>
- <li>It gives you access to other Android development tools from inside
- the Eclipse IDE. For example, ADT lets you access the many capabilities of the
- DDMS tool &mdash; taking screenshots, managing port-forwarding, setting breakpoints,
- and viewing thread and process information &mdash; directly from Eclipse.
- <li>It provides a New Project Wizard, which helps you quickly create and set up
- all of the basic files you'll need for a new Android application.</li>
- <li>It automates and simplifies the process of building your Android application.</li>
- <li>It provides an Android code editor that helps you write valid XML for your
- Android manifest and resource files.</li>
- </ul>
+ <dt><a href="hierarchy-viewer.html">Hierarchy Viewer</a></dt>
+ <dd>The Hierarchy Viewer tool allows you to debug and optimize your user interface.
+ It provides a visual representation of your layout's hierarchy of Views and a magnified inspector
+ of the current display with a pixel grid, so you can get your layout just right.
+ </dd>
- <p>For more information about the ADT plugin, including
- installation instructions, see <em>Installing the ADT Plugin for
- Eclipse</em> in your SDK package. For a usage example with screenshots, see the <a
- href="{@docRoot}tutorials/hello-android.html" title="Hello
- Android">Hello Android</a> tutorial.</p>
+ <dt><a href="draw9patch.html">Draw 9-patch</a></dt>
+ <dd>The Draw 9-patch tool 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="{@docRoot}ddms.html" >Dalvik Debug Monitor
+ <dt><a href="ddms.html" >Dalvik Debug Monitor
Service</a> (ddms)</dt>
<dd>Integrated with Dalvik, the Android platform's custom VM, this tool
lets you manage processes on an emulator or device and assists in debugging.
@@ -62,49 +40,49 @@ applications on the emulator. </p>
generate trace data, view heap and thread information, take screenshots
of the emulator or device, and more. </dd>
- <dt><a href="{@docRoot}adb.html" >Android Debug Bridge</a> (adb)</dt>
- <dd>The adb tool lets you install your application's .apk files on an
- emulator or device and access the emulator or device from a command line.
- You can also use it to link a standard debugger to application code running
- on an Android emulator or device.</dd>
+ <dt><a href="adb.html" >Android Debug Bridge</a> (adb)</dt>
+ <dd>The adb tool lets you install your application's .apk files on an
+ emulator or device and access the emulator or device from a command line.
+ You can also use it to link a standard debugger to application code running
+ on an Android emulator or device.</dd>
- <dt><a href="{@docRoot}aapt.html" >Android Asset
- Packaging Tool</a> (aapt)</dt>
- <dd>The aapt tool lets you create .apk files containing the binaries and
- resources of Android applications.</dd>
+ <dt><a href="aapt.html">Android Asset
+ Packaging Tool</a> (aapt)</dt>
+ <dd>The aapt tool lets you create .apk files containing the binaries and
+ resources of Android applications.</dd>
- <dt><a href="{@docRoot}aidl.html" >Android Interface
- Description Language</a> (aidl)</dt>
- <dd>Lets you generate code for an interprocess interface, such as what
- a service might use.</dd>
+ <dt><a href="aidl.html" >Android Interface
+ Description Language</a> (aidl)</dt>
+ <dd>Lets you generate code for an interprocess interface, such as what
+ a service might use.</dd>
- <dt><a href="{@docRoot}adb.html#sqlite">sqlite3</a></dt>
+ <dt><a href="adb.html#sqlite">sqlite3</a></dt>
<dd>Included as a convenience, this tool lets you access the SQLite data
files created and used by Android applications.</dd>
- <dt><a href="{@docRoot}traceview.html" >Traceview</a></dt>
- <dd> This tool produces graphical analysis views of trace log data that you
- can generate from your Android application. </dd>
+ <dt><a href="traceview.html" >Traceview</a></dt>
+ <dd> This tool produces graphical analysis views of trace log data that you
+ can generate from your Android application. </dd>
- <dt><a href="{@docRoot}othertools.html#mksdcard">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="othertools.html#mksdcard">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="{@docRoot}othertools.html#dx">dx</a></dt>
- <dd>The dx tool rewrites .class bytecode into Android bytecode
- (stored in .dex files.)</dd>
+ <dt><a href="othertools.html#dx">dx</a></dt>
+ <dd>The dx tool rewrites .class bytecode into Android bytecode
+ (stored in .dex files.)</dd>
- <dt><a href="{@docRoot}monkey.html" >UI/Application
+ <dt><a href="monkey.html">UI/Application
Exerciser Monkey</a></dt>
<dd>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.</dd>
- <dt><a href="{@docRoot}othertools.html#activitycreator">activitycreator</a></dt>
- <dd>A script that generates <a
- href="http://ant.apache.org/" title="Ant">Ant</a> build files that
- you can use to compile your Android applications. If you are developing
- on Eclipse with the ADT plugin, you won't need to use this script. </dd>
+ <dt><a href="othertools.html#activitycreator">activitycreator</a></dt>
+ <dd>A script that generates <a
+ href="http://ant.apache.org/" title="Ant">Ant</a> build files that
+ you can use to compile your Android applications. If you are developing
+ on Eclipse with the ADT plugin, you won't need to use this script. </dd>
</dl>
diff --git a/docs/html/guide/developing/tools/monkey.jd b/docs/html/guide/developing/tools/monkey.jd
index d829f5b..9a2ab6f 100644
--- a/docs/html/guide/developing/tools/monkey.jd
+++ b/docs/html/guide/developing/tools/monkey.jd
@@ -2,7 +2,7 @@ page.title=UI/Application Exerciser Monkey
@jd:body
<p>The Monkey is a program that runs on your
-<a href="{@docRoot}reference/emulator.html">emulator</a> or device and generates pseudo-random
+<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>
@@ -185,7 +185,7 @@ transitions invoked by your application.</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}reference/traceview.html" title="traceview">Traceview</a> for more information
+<a href="{@docRoot}guide/developing/tools/traceview.html" title="traceview">Traceview</a> for more information
on trace files.</td>
</tr>
diff --git a/docs/html/guide/developing/tools/othertools.jd b/docs/html/guide/developing/tools/othertools.jd
index 4ebcf4a..eaa0b76 100755..100644
--- a/docs/html/guide/developing/tools/othertools.jd
+++ b/docs/html/guide/developing/tools/othertools.jd
@@ -47,7 +47,7 @@ You can also specify size in kilobytes or megabytes, by appending a "K" or "M" t
</table>
-<p>Once you have created the disk image file, you can load it in the emulator at startup using the emulator's -sdcard option. For more information, see <a href="{@docRoot}reference/emulator.html">Android Emulator</a>.</p>
+<p>Once you have created the disk image file, you can load it in the emulator at startup using the emulator's -sdcard option. For more information, see <a href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a>.</p>
<pre>emulator -sdcard &lt;file&gt;</pre>
@@ -55,7 +55,7 @@ You can also specify size in kilobytes or megabytes, by appending a "K" or "M" t
<h2>dx</h2>
-<p>The dx tool lets you generate Android bytecode from .class files. The tool converts target files and/or directories to Dalvik executable format (.dex) files, so that they can run in the Android environment. It can also dump the class files in a human-readable format and run a target unit test. You can get the usage and options for this tool by using <code>dx -help</code>.</p>
+<p>The dx tool lets you generate Android bytecode from .class files. The tool converts target files and/or directories to Dalvik executable format (.dex) files, so that they can run in the Android environment. It can also dump the class files in a human-readable format and run a target unit test. You can get the usage and options for this tool by using <code>dx --help</code>.</p>
<a name="activitycreator"></a>
@@ -63,7 +63,7 @@ You can also specify size in kilobytes or megabytes, by appending a "K" or "M" t
<p>If you aren't using the Eclipse IDE and ADT plugin, you can use the the activitycreator script to get started with a new application. When you run the script, it creates the structure of a minimal Android application that you can build on and extend to meet your needs. </p>
-<p>For Linux and Mac, the SDK provides <code>activitycreator.py</code>, a Python script, and for Windows <code>activitycreator.bat</code>, a batch script that runs an executable. Regardless of platform, the usage for the script is the same:</p>
+<p>For Linux and Mac, the SDK provides <code>activitycreator</code>, a shell script, and for Windows <code>activitycreator.bat</code>, a batch script that runs an executable. Regardless of platform, the usage for the script is the same:</p>
<pre>activitycreator [--out &lt;folder&gt;] [--ide intellij] your.package.name.ActivityName</pre>
@@ -97,7 +97,7 @@ You can also specify size in kilobytes or megabytes, by appending a "K" or "M" t
<li>bin -- The output folder for the compiled .apk (when built by Ant).</li>
</ul>
-<p>When you are ready, you can use Ant to <a href="{@docRoot}intro/installing.html#buildingwithant">build the project</a> so that you can run it on the emulator.</p>
+<p>When you are ready, you can use Ant to <a href="{@docRoot}guide/developing/other-ide.html#antbuild">build the project</a> so that you can run it on the emulator.</p>
<p>If you are using Eclipse with the ADT plugin, you do not need to use activitycreator. You can use the New Project Wizard, provided by the ADT plugin, instead. </p>
diff --git a/docs/html/guide/developing/tools/traceview.jd b/docs/html/guide/developing/tools/traceview.jd
index 8c87eed..dd3f4bb 100644
--- a/docs/html/guide/developing/tools/traceview.jd
+++ b/docs/html/guide/developing/tools/traceview.jd
@@ -69,7 +69,7 @@ can create an SD card image and mount it when launching the emulator like so:</p
<b>$</b> emulator -sdcard ./img
</pre>
<p>For more information, read about the
-<a href="{@docRoot}reference/othertools.html#mksdcard">mksdcard tool</a>.</p>
+<a href="{@docRoot}guide/developing/tools/othertools.html#mksdcard">mksdcard tool</a>.</p>
<p>The format of the trace files is described <a href="#format">later
in this document</a>. </p>
@@ -111,7 +111,7 @@ the emulator host machine:</p>
the first row show the extent (entry to exit) of all the calls to the selected
method. The method in this case is LoadListener.nativeFinished() and it was
selected in the profile view. </p>
-<p><img src="../images/traceview_timeline.png" alt="Traceview timeline panel" width="893" height="284"></p>
+<p><img src="/images/traceview_timeline.png" alt="Traceview timeline panel" width="893" height="284"></p>
<a name="profilepanel"></a>
<h3>Profile Panel</h3>
<p>The image below shows the profile pane. The profile pane shows a
@@ -128,7 +128,7 @@ the emulator host machine:</p>
view, we can see that there were 14 calls to LoadListener.nativeFinished(); looking
at the timeline panel shows that one of those calls took an unusually
long time.</p>
-<p><img src="../images/traceview_profile.png" alt="Traceview profile panel." width="892" height="630"></p>
+<p><img src="/images/traceview_profile.png" alt="Traceview profile panel." width="892" height="630"></p>
<a name="format"></a>
<h2>Traceview File Format</h2>
diff --git a/docs/html/guide/developing/traceview.jd b/docs/html/guide/developing/traceview.jd
deleted file mode 100644
index 8c87eed..0000000
--- a/docs/html/guide/developing/traceview.jd
+++ /dev/null
@@ -1,310 +0,0 @@
-page.title=Traceview: A Graphical Log Viewer
-@jd:body
-
-<p>Traceview is a graphical viewer for execution logs
-saved by your application. The sections below describe how to use the program. </p>
-
-<h2>Contents</h2>
-
-<dl>
- <dt><a href="#creatingtracefiles">Creating Trace Files</a></dt>
- <dt><a href="#copyingfiles">Copying Trace Files to a Host Machine</a></dt>
- <dt><a href="#runningtraceview">Viewing Trace Files in Traceview</a></dt>
- <dd><a href="#timelinepanel">Timeline Panel</a></dd>
- <dd><a href="#profilepanel">Profile Panel</a></dd>
- <dt><a href="#format">Traceview File Format</a></dd>
- <dd><a href="#datafileformat">Data File Format</a><dd>
- <dd><a href="#keyfileformat">Key File Format</a></dd>
- <dt><a href="#knownissues">Traceview Known Issues</a></dd>
- <dt><a href="#dmtracedump">Using dmtracedump</a></dt>
-</dl>
-
-<a name="creatingtracefiles"></a>
-
-<h2>Creating Trace Files</h2>
-
-<p>To use Traceview, you need to generate log files containing the trace information you want to analyze. To do that, you include the {@link android.os.Debug}
- class in your code and call its methods to start and stop logging of trace information
- to disk. When your application quits, you can then use Traceview to examine the log files
- for useful run-time information such
- as method calls and run times. </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 startMethodTracing() in your activity's onCreate()
- method, and call stopMethodTracing() in that activity's 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>&lt;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 create an SD card image upon which
-the trace files will be written. For example, from the <code>/tools</code> directory, you
-can create an SD card image and mount it when launching the emulator like so:</p>
-<pre>
-<b>$</b> mksdcard 1024M ./imgcd
-<b>$</b> emulator -sdcard ./img
-</pre>
-<p>For more information, read about the
-<a href="{@docRoot}reference/othertools.html#mksdcard">mksdcard tool</a>.</p>
-
-<p>The format of the trace files is described <a href="#format">later
- in this document</a>. </p>
-
-<a name="copyingfiles"></a>
-
-<h2>Copying Trace Files to a Host Machine</h2>
-<p>After your application has run and the system has created your trace files <code>&lt;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>
-
-
-<a name="runningtraceview"></a>
-
-<h2>Viewing Trace Files in Traceview</h2>
-<p>To run traceview and view the trace files, enter <code>traceview &lt;trace-base-name></code>.
- For example, to run Traceview on the example files copied in the previous section,
- you would use: </p>
- <pre>traceview /tmp/calc</pre>
-
- <p>Traceview loads the log files and displays their data in a window that has 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>
-
-<a name="timelinepanel"></a>
-
-<h3>Timeline Panel </h3>
-<p>The image below shows a close up of the timeline panel. Each thread&rsquo;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 LoadListener.nativeFinished() and it was
- selected in the profile view. </p>
-<p><img src="../images/traceview_timeline.png" alt="Traceview timeline panel" width="893" height="284"></p>
-<a name="profilepanel"></a>
-<h3>Profile Panel</h3>
-<p>The image below shows the profile pane. The profile pane shows 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 &quot;parents&quot; and called methods as &quot;children.&quot;
- 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 LoadListener.nativeFinished(); looking
- at the timeline panel shows that one of those calls took an unusually
- long time.</p>
-<p><img src="../images/traceview_profile.png" alt="Traceview profile panel." width="892" height="630"></p>
-
-<a name="format"></a>
-<h2>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>
-
-<a name="datafileformat"></a>
-
-<h3>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 &quot;offset to data&quot; 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 gettimeofday().
- 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 &quot;exited&quot; 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>
-
-<a name="keyfileformat"></a>
-
-<h3>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 &lt;init&gt; ()V
-[...]
-0x080f630c android/os/Debug startMethodTracing ()V
-0x080f6350 android/os/Debug startMethodTracing (Ljava/lang/String;Ljava/lang/String;I)V
-*end</pre>
-<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>
-
-<a name="knownissues"></a>
-<h2>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>
-
-<a name="dmtracedump"></a>
-
-<h2>Using dmtracedump</h2>
-
-<p>The Android SDK includes dmtracedump, 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" style="margin-top:1em;"/>
-
-<p style="margin-top:1em;">For each node, dmtracedump shows <code>&lt;ref> <em>callname</em> (&lt;inc-ms>,
- &lt;exc-ms>,&lt;numcalls>)</code>, where</p>
-
-<ul>
- <li><code>&lt;ref></code> -- Call reference number, as used in trace logs</li>
- <li><code>&lt;inc-ms></code> -- Inclusive elapsed time (milliseconds spent in method, including all child methods)</li>
- <li><code>&lt;exc-ms></code> -- Exclusive elapsed time (milliseconds spent in method, not including any child methods)</li>
- <li><code>&lt;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] &lt;trace-base-name></pre>
-
-<p>The tool then loads trace log data from &lt;trace-base-name>.data and &lt;trace-base-name>.key.
- The table below lists the options for dmtracedump.</p>
-
-<table>
-<tr>
- <th>Option</td>
- <th>Description</th>
-</tr>
-
- <tr>
- <td><code>-d&nbsp;&lt;trace-base-name> </code></td>
- <td>Diff with this trace name</td>
- </tr>
- <tr>
- <td><code>-g&nbsp;&lt;outfile> </code></td>
- <td>Generate output to &lt;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&nbsp;&lt;trace-base-name> </code></td>
- <td>URL base to the location of the sortable javascript file</td>
- </tr>
- <tr>
- <td><code>-t&nbsp;&lt;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>
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index 70aaba4..577641c 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -1,85 +1,157 @@
<ul>
<li><h2>Android Basics</h2>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/basics/what-is-android.html">What Is Android?</a></li>
- <li><a href="<?cs var:toroot ?>guide/basics/">The Application Framework</a></li>
- <li><a style="color:gray;">The Android SDK</a></li>
- <li><a style="color:gray;">Developing for Android</a></li>
-<!-- signing, upgrading, selecting a package name, select device profile, touch, trackball, dpad available, etc. -->
- </ul>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/basics/what-is-android.html">What Is Android?</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><h2>Framework Topics</h2>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/topics/views/">Views and Layout</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/resources/">Resources and Assests</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/intents/">Intents and Intent Filtering</a></li>
- <li><a style="color:gray;">Processes and Threads</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/data/">Data Storage</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/contentproviders/">Content Providers</a></li>
- <li><a style="color:gray;">Notifications</a></li>
- <li><a style="color:gray;">Drawing</a></li>
- <li><a style="color:gray;">Localization</a></li>
- <li><a style="color:gray;">IPC</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/security/">Security</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/">The Manifest File</a></li>
- </ul>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/fundamentals.html">Application Fundamentals</a></li>
+ </ul>
+ <ul>
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>guide/topics/views/index.html">Views and Layout</a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/views/layout.html">Common Layout Objects</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/views/declaring-layout.html">Declaring Layout</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/views/binding.html">Binding to Data with AdapterView</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/views/ui-events.html">Handling UI Events</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/views/themes.html">Applying Styles and Themes</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/views/custom-components.html">Building Custom Components</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/views/how-android-draws.html">How Android Draws Views</a></li>
+ </ul>
+ </li>
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>guide/topics/resources/index.html">Resources and Assests</a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/resources-i18n.html">Resources and I18n</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/resources/available-resources.html">Available Resource Types</a></li>
+ </ul>
+ </li>
+ <li><a href="<?cs var:toroot ?>guide/topics/intents/intents-filters.html">Intents and Intent Filtering</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/data/data-storage.html">Data Storage</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/providers/content-providers.html">Content Providers</a></li>
+ <li><a style="color:gray;">Notifications</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/security/security.html">Security and Permissions</a></li>
+<!-- <li><a style="color:gray;">Processes and Threads</a></li> -->
+<!-- <li><a style="color:gray;">Interprocess Communication</a></li> -->
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/manifest.html">The Manifest File</a></li>
+ </ul>
+ <ul>
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>guide/topics/graphics/index.html">2D and 3D Graphics</a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/graphics/2d-graphics.html">2D Graphics</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/graphics/opengl.html">3D with OpenGL</a></li>
+ </ul>
+ </li>
+ <li><a href="<?cs var:toroot ?>guide/topics/media/index.html">Audio and Video</a></li>
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>guide/topics/sensors/index.html">Sensors</a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/sensors/camera.html">Camera</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/sensors/compass.html">Compass</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/sensors/accelerometer.html">Accelerometer</a></li>
+ </ul>
+ </li>
+ <li><a href="<?cs var:toroot ?>guide/topics/location/index.html">Location</a></li>
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>guide/topics/wireless/index.html">Wireless Controls</a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/topics/wireless/wifi.html">Wi-Fi</a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/wireless/bluetooth.html">Bluetooth</a></li>
+ </ul>
+ </li>
+<!-- <li><a style="color:gray;">Localization</a></li> -->
+ </ul>
</li>
<li><h2>Developing</h2>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/developing/eclipse.html">In Eclipse, with ADT</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/other-ide.html">In Other IDEs</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/">Debugging Tools</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/debug-tasks.html">Debugging Tasks</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/app-signing.html">Signing</a></li>
- <li><a style="color:gray;">Instrumentation</a></li>
- <li><a style="color:gray;">JUnit</a></li>
- </ul>
+ <ul>
+ <!-- <li><a style="color:gray;">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/eclipse-adt.html">In Eclipse, with ADT</a></li>
+ <li><a href="<?cs var:toroot ?>guide/developing/other-ide.html">In Other IDEs</a></li>
+ <li><a href="<?cs var:toroot ?>guide/developing/debug-tasks.html">Debugging Tasks</a></li>
+ <li class="toggle-list">
+ <div><a href="<?cs var:toroot ?>guide/developing/tools/index.html">Tools</a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/developing/tools/aapt.html">aapt</a></li>
+ <li><a href="<?cs var:toroot ?>guide/developing/tools/adb.html">adb</a></li>
+ <li><a href="<?cs var:toroot ?>guide/developing/tools/othertools.html#activitycreator">activitycreator</a></li>
+ <li><a href="<?cs var:toroot ?>guide/developing/tools/adt.html">ADT Plugin</a></li>
+ <li><a href="<?cs var:toroot ?>guide/developing/tools/aidl.html" >aidl</a></li>
+ <li><a href="<?cs var:toroot ?>guide/developing/tools/ddms.html" >ddms</a></li>
+ <li><a href="<?cs var:toroot ?>guide/developing/tools/othertools.html#dx">dx</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/hierarchy-viewer.html">Hierarchy Viewer</a></li>
+ <li><a href="<?cs var:toroot ?>guide/developing/tools/othertools.html#mksdcard">mksdcard</a></li>
+ <li><a href="<?cs var:toroot ?>guide/developing/tools/monkey.html">Monkey</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>
+ </ul></li>
+ <li><a href="<?cs var:toroot ?>guide/developing/instrumentation/index.html">Instrumentation</a></li>
+ <li><a style="color:gray;">JUnit</a></li>
+ </ul>
+
</li>
<li><h2>Publishing</h2>
- <ul>
- <li><a style="color:gray;">Preparing to Publish</a></li>
- <li><a style="color:gray;">Signing Your Application</a></li>
- <li><a style="color:gray;">Publishing on Android Market</a></li>
- <li><a style="color:gray;">Publishing on a Web Server</a></li>
- </ul>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/publishing/app-signing.html">Signing Your Applications</a></li>
+ <li><a href="<?cs var:toroot ?>guide/publishing/versioning.html">Versioning Your Applications</a></li>
+ <li><a href="<?cs var:toroot ?>guide/publishing/preparing.html">Preparing to Publish</a></li>
+ <li><a href="<?cs var:toroot ?>guide/publishing/publishing.html">Publishing Your Applications</a></li>
+ </ul>
</li>
<li><h2>Best Practices</h2>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/practices/design/performance.html">Designing for Performance</a></li>
- <li><a href="<?cs var:toroot ?>guide/practices/design/responsiveness.html">Designing for Responsiveness</a></li>
- <li><a href="<?cs var:toroot ?>guide/practices/design/seamlessness.html">Designing for Seamlessness</a></li>
- <li><a style="color:gray;">User Interface Guidelines</a></li>
- </ul>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/practices/design/performance.html">Designing for Performance</a></li>
+ <li><a href="<?cs var:toroot ?>guide/practices/design/responsiveness.html">Designing for Responsiveness</a></li>
+ <li><a href="<?cs var:toroot ?>guide/practices/design/seamlessness.html">Designing for Seamlessness</a></li>
+ <li><a style="color:gray;">User Interface Guidelines</a></li>
+ </ul>
</li>
+
<!--
<li><h2>Best Practices (alt)</h2>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/practices/design/">Design Goals</a></li>
- <li><a style="color:gray;">User Interface Guidelines</a></li>
- </ul>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/practices/design/index.html">Design Goals</a></li>
+ <li><a style="color:gray;">User Interface Guidelines</a></li>
+ </ul>
</li>
-->
+
<li><h2>Tutorials</h2>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/tutorials/hello-world.html">Hello World</a></li>
- <li><a href="<?cs var:toroot ?>guide/tutorials/views/hello-views-index.html">Hello Views</a></li>
- <li><a href="<?cs var:toroot ?>guide/tutorials/notepad/notepad-index.html">Notepad</a></li>
- <li><a href="<?cs var:toroot ?>samples/">Sample Code</a></li>
- </ul>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/tutorials/hello-world.html">Hello World</a></li>
+ <li><a href="<?cs var:toroot ?>guide/tutorials/views/index.html">Hello Views</a></li>
+ <li><a href="<?cs var:toroot ?>guide/tutorials/notepad/index.html">Notepad</a></li>
+ <li><a href="<?cs var:toroot ?>guide/samples/index.html">Sample Code</a></li>
+ </ul>
</li>
<li><h2>Appendix</h2>
- <ul>
- <li><a href="<?cs var:toroot ?>guide/appendix/media-formats.html">Supported Media Formats</a></li>
- <li><a href="<?cs var:toroot ?>guide/appendix/g-app-intents.html">Intents List: Google Apps</a></li>
- <li><a href="<?cs var:toroot ?>guide/appendix/glossary.html">Glossary</a></li>
- <li><a href="<?cs var:toroot ?>guide/appendix/faq/">FAQ</a></li>
- </ul>
+ <ul>
+ <li><a href="<?cs var:toroot ?>guide/appendix/media-formats.html">Supported Media Formats</a></li>
+ <li><a href="<?cs var:toroot ?>guide/appendix/g-app-intents.html">Intents List: Google Apps</a></li>
+ <li><a href="<?cs var:toroot ?>guide/appendix/glossary.html">Glossary</a></li>
+ <li><a href="<?cs var:toroot ?>guide/appendix/faq/index.html">FAQ</a></li>
+ </ul>
</li>
</ul>
+
+<script type="text/javascript">
+<!--
+ buildToggleLists();
+//-->
+</script> \ No newline at end of file
diff --git a/docs/html/guide/index.jd b/docs/html/guide/index.jd
index 280ab85..e723235 100644
--- a/docs/html/guide/index.jd
+++ b/docs/html/guide/index.jd
@@ -1,4 +1,62 @@
-page.title=Android Developer Guide
+page.title=Get Started
@jd:body
-FIXME \ No newline at end of file
+<p>Welcome to the Android Developer Guide! The <strong>Dev Guide</strong> is your conceptual and practical
+introduction to developing applications for Android. With this guide, you're free to explore
+which ever topics interest you, based on your goals and experience.</p>
+
+<p>If you're new to Android, you're probably wondering what it takes to
+write a "Hello, World" application. So here it is:</p>
+
+<pre>
+package com.example.hello;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.widget.TextView;
+
+public class HelloWorld extends Activity {
+
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ TextView tv = new TextView(this);
+ tv.setText(&quot;Hello, World&quot;);
+ setContentView(tv);
+ }
+
+}
+</pre>
+
+<p>That's the only code you need to write!</p>
+
+<h2 class="small-header">Not convinced?</h2>
+<p>If you're still shouting "Show me the code!" then take a look at
+more Android code in the <a href="{@docRoot}guide/tutorials/hello-world/index.html">Hello World Samples</a>.</p>
+
+<h2 class="small-header">Ready to start?</h2>
+<p>If you're already convinced you want to develop on Android,
+then we'll teach you how to build and run this "Hello, World" application in the
+<a href="{@docRoot}guide/tutorials/hello-world.html">Hello World Introduction</a>.</p>
+
+<h2 class="small-header">Ready for more?</h2>
+<p>Once you've got your feet wet (or just want to skip to the heart of Android), the following
+sections of the Dev Guide will educate you on the Android ins, outs, idioms and techniques:</p>
+<ul>
+ <li><em>Android Basics</em>:
+ Learn more about what Android is, what it offers, and how your application fits in.</li>
+ <li><em>Framework Topics</em>:
+ Become well versed in the practical matters of developing on Android &mdash; from drawing a UI, to storing data,
+ to drawing 3D graphics, and much more.</li>
+ <li><em>Developing</em>:
+ Learn more about developing with IDEs, using Android develop/debug tools, and testing.</li>
+ <li><em>Publishing</em>:
+ Learn how to get you application out there, for the world to enjoy!</li>
+ <li><em>Best Practices</em>:
+ Get some recommendations on preferred techniques to write the best applications.</li>
+ <li><em>Tutorials</em>:
+ Get help doing some of the basics, step by step.</li>
+ <li><em>Appendix</em>:
+ Flotsam and jetsam. Find some of those spare nuggets of information.</li>
+</ul>
+
+<p>For more help, you should consider joining one or more of the Android discussion groups. See the <a href="{@docRoot}community/index.html">Community</a> for more information.</p>
diff --git a/docs/html/guide/practices/design/responsiveness.jd b/docs/html/guide/practices/design/responsiveness.jd
index e0d1864..ecd743d 100644
--- a/docs/html/guide/practices/design/responsiveness.jd
+++ b/docs/html/guide/practices/design/responsiveness.jd
@@ -25,7 +25,7 @@ concern.)</p>
<div class="sidebox" style="margin-top:1em;border:0;">
<div style="border:0;background-color:#fff;padding:15px;padding-right:2em;margin:0;">
-<img src="/android/images/anr.png" width="240" height="320" alt="Screenshot of ANR dialog box">
+<img src="{@docRoot}images/anr.png" width="240" height="320" alt="Screenshot of ANR dialog box">
<p style="margin-top:.5em;padding:.5em;">An ANR dialog displayed to the user.</p>
</div>
</div>
diff --git a/docs/html/guide/practices/design/seamlessness.jd b/docs/html/guide/practices/design/seamlessness.jd
index 4d1dab0..caf0d6a 100644
--- a/docs/html/guide/practices/design/seamlessness.jd
+++ b/docs/html/guide/practices/design/seamlessness.jd
@@ -164,7 +164,7 @@ 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, <a href="{@docRoot}devel/ui/applying-themes.html">click here</a>.</p>
+the details, read <a href="{@docRoot}guide/topics/views/themes.html">Applying Styles and Themes</a>.</p>
<h2 id="flexui">Design Your UI to Work with Multiple Screen Resolutions</h2>
diff --git a/docs/html/guide/publishing/app-signing.jd b/docs/html/guide/publishing/app-signing.jd
new file mode 100644
index 0000000..1862b50
--- /dev/null
+++ b/docs/html/guide/publishing/app-signing.jd
@@ -0,0 +1,489 @@
+page.title=Signing Your Applications
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>Signing quickview</h2>
+
+<ul>
+<li>All Android apps <em>must</em> be signed</a></li>
+<li>You can sign with a self-signed key</li>
+<li>How you sign your apps is critical &mdash; 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="#overview">Overview</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 for Public Release</a>
+ <ol>
+ <li><a href="#releasecompile">Compiling for Release</a></li>
+ <li><a href="#cert">Obtaining a Suitable Private Key</a></li>
+ <li><a href="#signapp">Signing Your Application</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>This document provides information about signing your Android applications prior to publishing them for mobile device users.</p>
+
+<h2 id="overview">Overview</h2>
+
+<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 system uses the certificate as a means of identifying the author of
+an application and establishing trust relationships between applications, rather
+than for controlling 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
+that is not signed.</li>
+ <li>You can use self-signed certificates to sign your applications. No certificate authority
+is needed.</li>
+ <li>When you are ready to publish your application, you must sign it with a suitable private
+key. You can not publish an application that is signed with the default key generated
+by the SDK tools.
+ </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 &mdash; Keytool and Jarsigner &mdash; to generate keys and
+sign your application .apk files.</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 set up signing for your application before you will be able to
+run or debug it on an emulator or device.</p>
+
+<p>The Android SDK tools assist you in signing your applications when debugging. Both the ADT Plugin
+for Eclipse and the Ant build tool offer two signing modes &mdash; debug mode and release mode.
+
+<ul>
+<li>In debug mode, the build tools use the Keytool utility, included in the JDK, to create
+a keystore and key with a known alias and password. At each compilation, the tools then use
+the debug key to sign the application .apk file. Because the password is known, the tools
+don't need to prompt you for the keystore/key password each time you compile.</li>
+
+<li>When your application is ready for release, you compile it in release signing mode.
+In this mode, the tools compile your .apk <em>without</em> signing it. You must then sign
+the .apk manually &mdash; <span style="color:red">with your private key</span> &mdash;
+using Jarsigner (or similar tool). If you do not have a suitable private key already,
+you can run Keytool manually to generate your own keystore/key and then sign your
+application with Jarsigner.</li>
+</ul>
+
+<h2 id="strategies">Signing Strategies</h3>
+
+<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 &mdash; As you release upgrades to your
+application, you will want to sign the upgrades with the same certificate, if you
+want users to upgrade seamlessly to the new version. When the system is
+installing an update to an application, if any of the certificates in the
+new version match any of the certificates in the old version, then the
+system allows the update. If you sign the version without using a matching
+certificate, you will also need to assign a different package name to the
+application &mdash; in this case, the user installs the new version as a
+completely new application. </li>
+
+<li>Application modularity &mdash; The Android system allows applications that
+are signed by the same certificate to run in the same process, if the
+applications so request, 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 &mdash; 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 Android Market, the
+key you use to sign the application(s) must have a validity period
+ending after 22 October 2033. The Market server enforces this requirement
+to ensure that users can seamlessly upgrade Market 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>To support the generation of a keystore and debug key, you should first make sure that
+Keytool is available to the SDK build
+tools. In most cases, you can tell the SDK build tools how to find Keytool by making sure
+that your JAVA_HOME environment variable is set and that it references a suitable JDK.
+Alternatively, you can add the JDK version of Keytool to your PATH 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 PATH, it might be pointing to a symlink at
+/usr/bin/keytool. In this case, check the symlink target to make sure that it points
+to the Keytool in the JDK.</p>
+
+<p>If you will release your application to the public, you will also need to have
+the Jarsigner tool available on your machine. Both Jarsigner and Keytool are included
+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 it is installed in the emulator or a device.
+When you use debug mode, the SDK tools invoke Keytool to create a debug
+keystore and key. </p>
+
+<p>The SDK tools create the debug keystore/key with predetermined names/passwords;</p>
+<ul>
+<li>Keystore name &mdash; "debug.keystore"</li>
+<li>Keystore password &mdash; "android"</li>
+<li>Key alias &mdash; "androiddebugkey"</li>
+<li>Key password &mdash; "android"</li>
+<li>CN &mdash; "CN=Android Debug,O=Android,C=US"</li>
+</ul></p>
+
+<p>If you are developing in Eclipse/ADT and have set up Keytool as described
+above, signing in debug mode is enabled by default. When you run or debug your
+application, ADT signs the .apk with the debug certificate and installs it on
+the emulator. No specific action on your part is needed, provided ADT has
+access to Keytool.</p>
+
+<p>If you use Ant to build your .apk files, debug signing mode
+is enabled by default, assuming that you are using a build.xml file generated by the
+activitycreator tool included in the latest SDK. When you run Ant against build.xml to
+compile your app, the build script generates a keystore/key and signs the .apk for you.
+No specific action on your part is needed.</p>
+
+<p>If necessary, you can change the location/name of the debug keystore/key or
+supply a custom debug keystore/key to use. In Eclipse/ADT, you can use
+<strong>Windows</strong> &gt; <strong>Prefs</strong> &gt;
+<strong>Android</strong> &gt; <strong>Build</strong>. However, any custom debug
+keystore/key must use the same keystore/key names and passwords as the default
+debug key (as described above). </p>
+
+<p>Note that you <em>cannot</em> release your application to the public if it
+is signed with the debug certificate. </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. On Linux/Mac OSX,
+the file is stored in <code>~/.android</code>. On Windows XP, the file is stored in <code>
+C:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Android</code>.
+On Windows Vista, the file is stored in <code>
+C:\Users\&lt;user&gt;\AppData\Local\Android</code>.</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}guide/appendix/faq/troubleshooting.html#signingcalendar">
+I&nbsp;can't&nbsp;compile my app because the build tools generated an expired debug
+certificate</a>. </p>
+
+<h2 id="releasemode">Signing for Public Release</h2>
+
+<p>When your application is ready for release to other users, you must:</p>
+<ol>
+<li>Compile the application in release mode</li>
+<li>Obtain a suitable private key, and then</li>
+<li>Sign the application with your private key</li>
+<li>Secure your private key</li>
+</ol>
+
+<p>The sections below provide information about these steps. </p>
+
+<h3 id="releasecompile">Compiling for Release</h3>
+
+<p>To prepare your application for release, you must first compile it in release mode.
+In release mode, the Android build tools compile your application as usual,
+but without signing it with the debug key. </p>
+
+<p>If you are developing in Eclipse/ADT, right-click the project in the Package
+pane and select <strong>Android Tools</strong> > <strong>Export Application
+Package</strong>. You can then specify the file location for the unsigned .apk.
+Alternatively, you can follow the "Exporting the unsigned .apk"
+link in the Manifest Editor overview page. </p>
+
+<p>If you are using Ant, all you need to do is specify the build target
+"release" in the Ant command. For example, if you are running Ant from the
+directory containing your build.xml file, the command would look like this:</p>
+
+<pre>$ ant release</pre>
+
+<p>The build script compiles the application .apk without signing it.
+
+<p>Note that you can not release your application unsigned, or signed with the debug key.</p>
+
+<h3 id="cert">Obtaining 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 Android Market, 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">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>-keystore&nbsp;&lt;keystore-name&gt;.keystore</code></td><td>A name
+for the keystore containing the private key.</td>
+</tr>
+<tr>
+<td><code>-storepass &lt;password&gt;</code></td><td><p>A 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, 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>-alias &lt;alias_name&gt;</code></td><td>An alias for the key.</td>
+</tr>
+<tr>
+<td><code>-keyalg &lt;alg&gt;</code></td><td>The encryption algorithm to use
+when generating the key. Both DSA and RSA are supported.</td>
+</tr>
+<tr>
+<td><code>-dname &lt;name&gt;</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>-validity &lt;valdays&gt;</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>-keypass &lt;password&gt;</code></td><td><p>The password for the 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, 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 -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 &mdash;
+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://java.sun.com/j2se/1.5.0/docs/tooldocs/#security">
+http://java.sun.com/j2se/1.5.0/docs/tooldocs/#security</a></p>
+
+<h3 id="signapp">Signing Your Application</h3>
+
+<p>When you are ready to actually sign your .apk for release, you can do so
+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&nbsp;&lt;keystore-name&gt;.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>-storepass &lt;password&gt;</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 &lt;password&gt;</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 -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>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">Note: 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://java.sun.com/j2se/1.5.0/docs/tooldocs/#security">
+http://java.sun.com/j2se/1.5.0/docs/tooldocs/#security</a></p>
+
+<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/preparing.jd b/docs/html/guide/publishing/preparing.jd
new file mode 100644
index 0000000..1f3c624
--- /dev/null
+++ b/docs/html/guide/publishing/preparing.jd
@@ -0,0 +1,252 @@
+page.title=Preparing to Publish: A Checklist
+@jd:body
+
+<!--
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+
+<ol>
+<li><a href=""></a></li>
+</ol>
+
+</div>
+</div>
+-->
+
+<p>Publishing an application means testing it, packaging it appropriately, and
+making it available to users of Android-powered mobile devices.</p>
+
+<p>If you plan to publish your application for installation on Android-powered devices,
+there are several things you need to do, to get your application ready. This document
+the significant checkpoints for preparing your application for a successful release. </p>
+
+<p>If you will publish your application on Android Market, please also see <a
+href="{@docRoot}guide/publishing/publishing.html#market">Publishing on Android Market</a>
+for specific preparation requirements for your application. </p>
+
+<p>For general information about the ways that you can publish an applications,
+see the <a href="{@docRoot}guide/publishing/publishing.html">Publishing Your
+Applications</a> document. </p>
+
+<div class="special">
+
+<p>Before you consider your application ready for release:</p>
+
+<ol>
+<li>Test your application extensively on an actual device </li>
+<li>Consider adding an End User License Agreement in your application</li>
+<li>Specify an icon and label in the application's manifest</li>
+<li>Turn off logging and debugging and clean up data/files</li>
+</ol>
+
+<p>Before you do the final compile of your application:</p>
+
+<ol start="5">
+<li>Version your application</li>
+<li>Obtain a suitable cryptographic key</li>
+<li>Register for a Maps API Key, if your application is using MapView elements</li>
+</ol>
+
+<p><em>Compile your application...</em></p>
+<p>After compiling your application:</p>
+<ol start="8">
+<li>Sign your application</li>
+<li>Test your compiled application</li>
+</ol>
+</div>
+
+<h2 id="releaseready">Before you consider your application ready for release</h2>
+
+<h3 id="test">1. Test your application extensively on an actual device</h3>
+
+<p>It's important to test your application as extensively as possible, in as
+many areas as possible. To help you do that, Android provides a variety of
+testing classes and tools. You can use
+{@link android.app.Instrumentation Instrumentation} to run JUnit and other
+test cases, and you can use testing
+tools such as the <a href="{@docRoot}guide/developing/tools/monkey.html">UI/Application
+Exerciser Monkey</a>. </p>
+
+<ul>
+<li>To ensure that your application will run properly for users, you should make
+every effort to obtain one or more physical mobile device(s) of the type on
+which you expect the application to run. You should then test your application
+on the actual device, under realistic network conditions. Testing your
+application on a physical device is very important, because it enables you to
+verify that your user interface elements are sized correctly (especially for
+touch-screen UI) and that your application's performance and battery efficiency
+are acceptable.</li>
+
+<li>If you can not obtain a mobile device of the type you are targeting for your
+application, you can use emulator options such as <code>-dpi</code>,
+<code>-device</code>, <code>-scale</code>, <code>-netspeed</code>,
+<code>-netdelay</code>, <code>-cpu-delay</code> and others to model the
+emulator's screen, network performance, and other attributes to match the target
+device to the greatest extent possible. You can then test your application's UI
+and performance. However, we strongly recommend that you test your application
+on an actual target device before publishing it. </li>
+
+<li>If you are targeting the <a href="http://www.t-mobileg1.com/">T-Mobile
+G1</a> device for your application, make sure that your UI handles screen
+orientation changes. </li>
+</ul>
+
+<h3 id="eula">2. Consider adding an End User License Agreement in your
+application</h4>
+
+<p>To protect your person, organization, and intellectual property, you may want
+to provide an End User License Agreement (EULA) with your application.
+
+<h3 id="iconlabel">3. Specify an icon and label in the application's manifest</h4>
+
+<p>The icon and label that you specify in an application's manifest are
+important because they are displayed to users as your application's icon and
+name. They are displayed on the device's Home screen, as well as in Manage
+Applications, My Downloads, and elsewhere. Additionally, publishing services may
+display the icon and label to users. </p>
+
+<p>To specify an icon and label, you define the attributes
+<code>android:icon</code> and <code>android:label</code> in the
+<code>&lt;application&gt;</code> element of the manifest. </p>
+
+<p>As regards the design of your icon, you should try to make it match as much
+as possible the style used by the built-in Android applications.</p>
+
+<h3 id="logging">4. Turn off logging and debugging and clean up data/files</h4>
+
+<p>For release, you should make sure that debug facilities are turned off and
+that debug and other unnecessary data/files are removed from your application
+project.</p>
+<ul>
+<li>Remove the <code>android:debuggable="true"</code> attribute from the
+<code>&lt;application&gt;</code> element of the manifest.</li>
+<li>Remove log files, backup files, and other unnecessary files from the
+application project.</li>
+<li>Check for private or proprietary data and remove it as necessary.</li>
+<li>Deactivate any calls to {@link android.util.Log} methods in the source
+code.</li>
+</ul>
+
+<h2 id="finalcompile">Before you do the final compile of your application</h3>
+
+<h3 id="versionapp">5. Version Your Application</h4>
+
+<p>Before you compile your application, you must make sure that you have defined
+a version number for your application, specifying an appropriate value for both
+the <code>android:versionCode</code> and <code>android:versionName</code>
+attributes of the <code>&lt;manifest&gt;</code> element in the application's
+manifest file. Carefully consider your version numbering plans in the context of
+your overall application upgrade strategy. </p>
+
+<p>If you have previously released a version of your application, you must make
+sure to increment the version number of the current application. You must
+increment both the <code>android:versionCode</code> and
+<code>android:versionName</code> attributes of the <code>&lt;manifest&gt;</code>
+element in the application's manifest file, using appropriate values. </p>
+
+<p>For detailed information about how to define version information for your
+application, see <a href="{@docRoot}guide/publishing/versioning.html">Versioning Your Applications</a>.</p>
+
+<h3 id="cryptokey">6. Obtain a suitable cryptographic key</h4>
+
+<p>If you have read and followed all of the preparation steps up to this point,
+your application is compiled and ready for signing. Inside the .apk, the
+application is properly versioned, and you've cleaned out extra files and
+private data, as described above. </p>
+
+<p>Before you sign your application, you need to make sure that you have a
+suitable private key. For complete information about how to obtain (or generate)
+a private key, see <a href="#cert">Obtaining a Private Key</a>.</p>
+
+<p>Once you have obtained (or generated) a suitable private key, you will use it
+to:</p>
+
+<ul>
+<li>Register for a Maps API Key (see below), if your application uses MapView
+elements.</li>
+<li>Sign your application for release</li>
+</ul>
+
+
+<h3 id="mapsApiKey">7. Register for a Maps API Key, if your application is using
+MapView elements</h3>
+
+<div class="sidebox" style="margin-bottom:.5em;"><p>For complete information
+about getting a Maps API Key, see <a
+href="{@docRoot}guide/developing/mapkey.html">Obtaining a Maps API
+Key</a>.<br></p></div>
+
+<p>If your application uses one or more
+{@link-fixme com.google.android.maps.MapView Mapview} elements, you will need to
+register your application with the Google
+Maps service and obtain a Maps API Key, before your MapView(s) will be able to
+retrieve data from Google Maps. To do so, you supply an MD5 fingerprint of your
+signer certificate to the Maps service. </p>
+
+<p>During development, you can get a temporary Maps API Key by registering the
+debug key generated by the SDK tools. However, before publishing your
+application, you must register for a new Maps API Key that is based on your
+private key. </p>
+
+<p>If your application uses MapView elements, the important points to understand
+are:</p>
+
+<ol>
+<li>You <em>must</em> obtain the Maps API Key before you compile your
+application for release, because you must add the Key to a special attribute in
+each MapView element &mdash; <code>android:apiKey</code> &mdash; in your
+application's layout files. If you are instantiating MapView objects directly
+from code, you must pass the Maps API Key as a parameter in the constructor.
+</li>
+<li>The Maps API Key referenced by your application's MapView elements must be
+registered (in Google Maps) to the certificate used to sign the application.
+This is particularly important when publishing your application &mdash; your
+MapView elements must reference a Key that is registered to the release
+certificate that you will use to sign your application. </li>
+<li>If you previously got a temporary Maps API Key by registering the debug
+certificate generated by the SDK tools, you <em>must</em> remember to obtain a
+new Maps API Key by registering your release certificate. You must then remember
+to change the MapView elements to reference the new Key, rather than the Key
+associated with the debug certificate. If you do not do so, your MapView
+elements will not have permission to download Maps data. </li>
+<li>If you change the private key that you will use to sign your application,
+you <em>must</em> remember to obtain a new Maps API Key from the Google Maps
+service. If you do not get a new Maps API Key and apply it to all MapView
+elements, any MapView elements referencing the old Key will not have permission
+to download Maps data. </li>
+</ol>
+
+<p>For more information about signing and your private key, see <a
+href="#signing">Signing Your Applications</a>.</p>
+
+
+<h2 id="compile">Compile Your Application</h3>
+
+<p>When you've prepared your application as described in the previous sections,
+you can compile your application for release. </p>
+
+<h2 id="post-compile">After Compiling Your Application</h3>
+
+<h3 id="signapp">8. Sign Your Application</h4>
+
+<p>Sign your application using your private key. Signing your application
+correctly is critically important. Please see <a href="#signing">Signing Your
+Applications</a> for complete information. </p>
+
+<h3 id="testapp">9. Test Your Compiled and Signed Application</h4>
+
+<p>Before you release your compiled application, you should thoroughly test it
+on the target mobile device (and target network, if possible). In particular,
+you should make sure that any MapView elements in your UI are receiving maps
+data properly. If they are not, go back to <a href="#mapsApiKey">Register for a
+Maps API Key</a> and correct the problem. You should also ensure that the
+application works correctly with any server-side services and data that you are
+providing or are relying on and that the application handles any authentication
+requirements correctly. </p>
+
+<p>After testing, you are now ready to publish your application to mobile device
+users.</p>
+
+
diff --git a/docs/html/guide/publishing/publishing.jd b/docs/html/guide/publishing/publishing.jd
new file mode 100644
index 0000000..1a022dd
--- /dev/null
+++ b/docs/html/guide/publishing/publishing.jd
@@ -0,0 +1,250 @@
+page.title=Publishing Your Applications
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>Publishing quickview</h2>
+
+<ul>
+<li>You can publish your application using a hosted service such as Android Market or through a web server.</li>
+<li>Before you publish, make sure you have prepared your application properly.</li>
+<li>Android Market makes it easy for users of Android-powered devices to see and download your application.</li>
+</ul>
+
+
+<h2>In this document</h2>
+
+<ol>
+<li><a href="#overview">Publishing on Android Market</a>
+ <ol>
+ <li><a href="#marketupgrade">Publishing Upgrades on Android Market</a>
+ <li><a href="#marketintent">Using Intents to Launch the Market Application</a></li>
+ </ol></li>
+
+<li><span style="color:ccc">Publishing on Other Hosted Services</a></li>
+<li><span style="color:ccc">Publishing through a Web Server</a></li>
+
+</ol>
+
+<h2>See also</h2>
+
+<ol>
+<li><a href="{@docRoot}guide/publishing/preparing.html">Preparing to Publish</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_market.jpg" style="float:left;margin:0;padding:0;">
+ <p style="color:#669999;">Interested in publishing your app on Android Market?</p>
+ <a id="publish-link" href="http://market.android.com/publish">Go to Android Market &raquo;</a>
+ </div>
+</div>
+
+</div>
+</div>
+
+<p>Publishing an application means testing it, packaging it appropriately, and making
+it available to users of Android-powered mobile devices for download or sideload.</p>
+
+<p>If you've followed the steps outlined in
+<a href="{@docRoot}guide/publishing/preparing.html">Preparing to
+Publish Your Applications</a>, the result of the process is a compiled .apk that
+is signed with your release private key. Inside the .apk, the application is
+properly versioned and any MapView elements reference a Maps API Key that you
+obtained by registering the MD5 fingerprint of the same certificate used to sign
+the .apk. Your application is now ready for publishing. </p>
+
+<p>The sections below provide information about publishing your Android
+application to mobile device users.</p>
+
+<h2 id="market">Publishing on Android Market</h2>
+
+<p>Android Market is a hosted service that makes it easy for users to find and
+download Android applications to their Android-powered devices, and makes it
+easy for developers to publish their applications to Android users.</p>
+
+<p>To publish your application on Android Market, you first need to register
+with the service using your Google account and agree to the terms of service.
+Once you are registered, you can upload your application to the service whenever
+you want, as many times as you want, and then publish it when you are ready.
+Once published, users can see your application, download it, and rate it using
+the Market application installed on their Android-powered devices. </p>
+
+<p>To register as an Android Market developer and get started with publishing,
+visit the Android Market: </p>
+
+<p style="margin-left:3em;"><a
+href="http://market.android.com/publish">http://market.android.com/publish</a>
+</p>
+
+<p>If you plan to publish your application on Android Market, you must make sure
+that it meets the requirements listed below, which are enforced by the Market
+server when you upload the application.</p>
+
+<div class="special">
+<p>Requirements enforced by the Android Market server</p>
+<ol>
+<li>Your application must be signed with a cryptographic private key whose
+validity period ends after <span style="color:red">22 October 2033</span>. </li>
+<li>Your application must define both an <code>android:versionCode</code> and an
+<code>android:versionName</code> attribute in the <code>&lt;manifest&gt;</code>
+element of its manifest. The server uses the <code>android:versionCode</code> as
+the basis for identifying the application internally and handling upgrades, and
+it displays the <code>android:versionName</code> to users as the application's
+version.</li>
+<li>Your application must define both an <code>android:icon</code> and an
+<code>android:label</code> attribute in the <code>&lt;application&gt;</code>
+element of its manifest.</li>
+</ol>
+</div>
+
+<h3 id="marketupgrade">Publishing Upgrades on Android Market</h3>
+
+<p>The beta version of Android Market does not support notifying your users when
+you publish a new version of your application. This capability will be
+added soon, but currently the user must independently initiate download of an
+upgraded application. When you publish an upgrade, you can assist users by
+notifying them that the upgrade is available and giving them a way to download
+the upgraded application from Android Market.</p>
+
+<p>Here is a suggested way of tracking installed application versions and
+notifying users that an upgrade is available:</p>
+
+<ol>
+<li>Have your app occasionally check in with a web-service that you're
+running. This web service should return two values: the latest available
+version number for the application (corresponding to
+<code>android:versionCode</code>) and a URI string that your application
+can later send in an Intent, to launch Market and search for the
+upgraded application for the user.
+
+<p>The URI that your web service returns should be properly formatted to
+search Android Market for your upgraded application. See
+<a href="#marketintent">Using Intents to Launch the Market Application</a>
+for more information. The URI should specify the upgraded
+application's package name as the query parameter, since the package name
+is guaranteed to be unique on Android Market. The URI format for the
+package name search is: </p>
+
+<p><code>http://market.android.com/search?q=pname:&lt;package&gt;</code> or
+<br><code>market://search?q=pname:&lt;package&gt;</code></p>
+
+</li>
+<li>Your application can then compare its own version number against
+that retrieved. If the retrieved value is greater, your application can
+show a dialog informing the user that a new version is available. The
+dialog can offer buttons to begin the download or cancel. </li> <li>If
+the user clicks the button to begin the download, your application can
+call startActivity() using the ACTION_VIEW Intent, passing the URI
+received from your web service. The Intent launches the Market
+application on the device and initiates an immediate search on the
+Android Market site, based on the query parameters in the URI. When the
+result is displayed, the user can view the details of the upgraded
+application and begin the download.
+
+<p>Note that, because the URI string is received from your web
+service and not hard-coded into your application, you can easily change
+the Market launch behaviors whenever needed, without
+having to change your application. </p></li></ol>
+
+<p>For more information about URIs you can pass to the Market application at
+launch, see <a href="#marketintent">Using Intents to Launch the Market
+Application</a>, below.</p>
+
+<h3 id="marketintent">Using Intents to Launch the Market Application on
+a Device</h3>
+
+<p>Android-powered devices include a preinstalled Market application that gives
+users access to the Android Market site. From Market, users can
+browse or search available applications, read ratings and reviews, and
+download/install applications.</p>
+
+<p>You can launch the Market application from another Android
+application by sending an Intent to the system. You might want to do
+this, for example, to help the user locate and download an upgrade to an
+installed application, or to let the user know about related
+applications that are available for download. </p>
+
+<p>To launch Market, you send an ACTION_VIEW Intent, passing a Market-handled
+URI string as the Intent data. In most cases, your application would call
+startActivity() to send the ACTION_VIEW Intent with the Market-handled URI.</p>
+
+<p>The URI that you supply with the Intent lets the system route the intent
+properly and also expresses the type of action that you want Market to perform
+after launch. Currently, you can have Market initiate a search for applications
+on Android Market, based on query parameters that you provide. For example, you
+can specify URIs to search for applications by:</p>
+
+<ul>
+<li>Package name</li>
+<li>Developer name</li>
+<li>String match across application name, developer name, and
+description, or </li>
+<li>Any combination of the above</li>
+</ul>
+
+<p>Note that the URI queries return results from the public metadata supplied by
+developers in their Android Market profiles or application publishing
+information, but not from the developer's private account or from the
+certificate used to sign the application. </p>
+
+<p>The table below provides a list of URIs and actions currently
+supported by the Market application.</p>
+
+<table>
+<tr>
+<th>For this Result</th>
+<th>Pass this URI with the ACTION_VIEW Intent</th>
+<th>Comments</th>
+</tr>
+
+<!--
+<tr>
+<td>Display the details screen for a specific application, as identified
+by its Market appID string.</td>
+<td><code>http://market.android.com/details?id=&lt;appMarketAppIdString&gt;</code>
+or<br>
+<code>market://details?id=&lt;appMarketUidString&gt;</code></td>
+<td>Note that Market appID is specific to an application
+<em>and</em> its version. That is, an appID query loads the details page
+for a specific version of an application.</td>
+</tr>
+-->
+<tr>
+<td>Search for an application by its fully qualified Java package name and
+display the result.</td>
+<td><code>http://market.android.com/search?q=pname:&lt;package&gt;</code> or<br>
+<code>market://search?q=pname:&lt;package&gt;</code></td>
+<td>Searches only the Java package name of applications. Returns only exact
+matches.</td>
+</tr>
+
+<tr>
+<td>Search for applications by developer name and display the results.</td>
+<td><code>http://market.android.com/search?q=pub:"&lt;Developer&nbsp;Name&gt;"</code>
+or<br> <code>market://search?q=pub:"&lt;Developer Name&gt;"</code></td>
+<td>Searches only the "Developer Name" fields of Market public profiles.
+Returns exact matches only. </td>
+</tr>
+
+<tr>
+<td>Search for applications by substring and display the results.</td>
+<td><code>http://market.android.com/search?q=&lt;substring&gt;</code> or
+<br><code>market://search?q=&lt;substring&gt;</code></td>
+<td>Searches all public fields (application title, developer name, and
+application description) for all applications. Returns exact and partial
+matches.</td>
+</tr>
+
+<tr>
+<td>Search using multiple query parameters and display the results.</td>
+<td>Example:<p><code>http://market.android.com/search?q=world pname:com.android.hello pub:Android</code></p></td>
+<td>Returns a list of applications meeting all the supplied parameters. </td>
+</tr>
+</table>
+
+<p>Note that these URIs work only when passed as intent data &mdash; you
+can't currently load the URIs in a web browser, either on a desktop machine or
+on the device. </p> \ No newline at end of file
diff --git a/docs/html/guide/publishing/versioning.jd b/docs/html/guide/publishing/versioning.jd
new file mode 100644
index 0000000..1f4df0b
--- /dev/null
+++ b/docs/html/guide/publishing/versioning.jd
@@ -0,0 +1,135 @@
+page.title=Versioning Your Applications
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>Versioning 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>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 Android Market</a></li>
+<li><a href="{@docRoot}guide/topics/manifest/manifest.html">The Manifest File</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>Versioning is a critical component of your application upgrade/maintenance
+strategy. </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 &mdash; including other applications that you publish as
+a suite &mdash; 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 itself <em>does not ever</em> check the version
+information for an application, such as to enforce restrictions on upgrades,
+compatibility, and so on. Instead, only users or applications themselves are
+responsible for enforcing any version restrictions. </p>
+
+<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> &mdash; 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 programatically
+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 resemblence 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> &mdash; 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
+&lt;major&gt;.&lt;minor&gt;.&lt;point&gt; 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>&lt;manifest&gt;</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>&lt;manifest&gt;</code> element. </p>
+
+<pre>
+&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.package.name"
+ android:versionCode="2"
+ android:versionName="1.1"&gt;
+ &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
+ ...
+ &lt;/application&gt;
+&lt;/manifest&gt;
+</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:codeName</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>
+
+<p>If your application requires a specific minimum version of the Android
+platform, you can also specify that in the manifest file: </p>
+
+<ul>
+<li><code>android:minSdkVersion</code> &mdash; An integer value corresponding to
+the code version of the Android platform.
+<p>When preparing to install an 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. </p>
+
+<p>If you do not specify this attribute in your manifest, the system assumes
+that your application is compatible with all platform versions.</p></li>
+</ul>
+
+<p>To specify a minimum platform version for your application, add a
+<code>&lt;uses-sdk&gt;</code> element as a child of
+<code>&lt;manifest&gt;</code>, then define the
+<code>android:minSdkVersion</code> as an attribute. Currently, only one platform
+version has been released for mobile devices &mdash; that version is "1". For
+this reason, you do not need to define this attribute in your application and,
+at this point, defining it is <em>not recommended</em>.</p> \ No newline at end of file
diff --git a/docs/html/guide/samples/index.jd b/docs/html/guide/samples/index.jd
index 0224a56..c2dbb48 100644
--- a/docs/html/guide/samples/index.jd
+++ b/docs/html/guide/samples/index.jd
@@ -7,11 +7,11 @@ page.title=Android Samples
So here we've provided the source code for some simple Android applications.</p>
<dl>
- <dt><a href="ApiDemos/">API Demos</a></dt>
+ <dt><a href="ApiDemos/index.html">API Demos</a></dt>
<dd>A variety of small applications that demonstrate simple views and widgets.</dd>
- <dt><a href="LunarLander/">Lunar Lander</a></dt>
+ <dt><a href="LunarLander/index.html">Lunar Lander</a></dt>
<dd>A classic Lunar Lander game.</dd>
- <dt><a href="NotePad/">Notepad</a></dt>
+ <dt><a href="NotePad/index.html">Note Pad</a></dt>
<dd>An application for saving notes. Similar (but not identical) to the
- <a href="{@docRoot}guide/tutorials/notepad/notepad-index.html">Notepad tutorial</a>.</dd>
+ <a href="{@docRoot}guide/tutorials/notepad/index.html">Notepad tutorial</a>.</dd>
</dl> \ No newline at end of file
diff --git a/docs/html/guide/topics/data/contentproviders.jd b/docs/html/guide/topics/data/contentproviders.jd
deleted file mode 100644
index 343ed84..0000000
--- a/docs/html/guide/topics/data/contentproviders.jd
+++ /dev/null
@@ -1,608 +0,0 @@
-page.title=Accessing Content Providers
-@jd:body
-
-<p>If you want to make your data public, you can create (or call) a content
-provider. This is an object that can store and retrieve data accessible by all
-applications. This is the only way to share data across packages; there is no
-common storage area that all packages can share. Android ships with a number
-of content providers for common data types (audio, video, images, personal
-contact information, and so on). You can see some of
-Android's native content providers in the {@link android.provider provider} package.</p>
-
-<p>How a content provider actually stores its data under the covers is up to
-the implementation of the content provider, but all content providers must
-implement a common convention to query for data, and a common convention to
-return results. However, a content provider can implement custom helper
-functions to make data storage/retrieval simpler for the specific data that it
-exposes.</p>
-
-<p>This document covers two topics related to Content Providers:</p>
-<ul>
- <li><a href="#usingacp">Using a Content Provider</a></li>
- <li><a href="#creatingacontentprovider">Creating a Content Provider</a></li>
-</ul>
-
-<h2>Using a Content Provider to Store and Retrieve Data <a name="usingacp"
-id="usingacp"></a></h2>
-
-<p>This section describes how to store and retrieve data using a content
-provider implemented by you or anyone else. Android exposes a number of
-content providers for a wide range of data types, from music and image files
-to phone numbers. You can see a list of content providers exposed through the
-convenience classes in the {@link android.provider android.provider} package.</p>
-
-<p>Android's content providers are loosely linked to their clients. Each
-content provider exposes a unique string (a URI) identifying the type of data
-that it will handle, and the client must use that string to store or retrieve
-data of that type. We'll explain this more in <a href="#querying">Querying for
-Data</a>.</p>
-
-<p>This section describes the following activities:</p>
-
-<ul>
- <li>
- <a href="#querying">Querying for Data</a>
-
- <ul>
- <li>Making the query</li>
-
- <li>What the query returns</li>
-
- <li>Querying for files</li>
-
- <li>Reading retrieved data</li>
- </ul>
- </li>
-
- <li><a href="#modifyingdata">Modifying Data</a></li>
-
- <li><a href="#addingrecord">Adding a Record</a></li>
-
- <li><a href="#deletingrecord">Deleting a Record</a></li>
-</ul>
-
-<a name="querying" id="querying"></a>
-<h4>Querying for Data</h4>
-
-<p>Each contact provider exposes a unique public URI (wrapped by {@link android.net.Uri})
-that is used by a client to query/add/update/delete data on that content
-provider. This URI has two forms: one to indicate all values of that type
-(e.g., all personal contacts), and one form to indicate a specific record of
-that type (e.g., Joe Smith's contact information).</p>
-
-<ul>
- <li><strong>content://contacts/people/</strong> is the URI that would return a list of all contact names on the device.</li>
-
- <li><strong>content://contacts/people/23</strong> is the URI string that would return a single result row, the contact with ID = 23. .</li>
-</ul>
-
-<p>An application sends a query to the device that specifies a general type of
-item (all phone numbers), or a specific item (Bob's phone number), to
-retrieve. Android then returns a Cursor over a recordset of results, with a
-specific set of columns. Let's look at a hypothetical query string and a
-result set (the results have been trimmed a bit for clarity):</p>
-
-<p>query = <code>content://contacts/people/</code></p>
-
-<p>Results:</p>
-
-<table border="1">
- <tbody>
- <tr>
- <th scope="col">_ID</th>
-
- <th scope="col">_COUNT</th>
-
- <th scope="col">NUMBER</th>
-
- <th scope="col">NUMBER_KEY</th>
-
- <th scope="col">LABEL</th>
-
- <th scope="col">NAME</th>
-
- <th scope="col">TYPE</th>
- </tr>
-
- <tr>
- <td>13</td>
-
- <td>4</td>
-
- <td>(425) 555 6677</td>
-
- <td>425 555 6677</td>
-
- <td>Kirkland office</td>
-
- <td>Bully Pulpit</td>
-
- <td>Work</td>
- </tr>
-
- <tr>
- <td>44</td>
-
- <td>4</td>
-
- <td>(212) 555-1234</td>
-
- <td>212 555 1234</td>
-
- <td>NY apartment</td>
-
- <td>Alan Vain</td>
-
- <td>Home</td>
- </tr>
-
- <tr>
- <td>45</td>
-
- <td>4</td>
-
- <td>(212) 555-6657</td>
-
- <td>212 555 6657</td>
-
- <td>Downtown office</td>
-
- <td>Alan Vain</td>
-
- <td>Work</td>
- </tr>
-
- <tr>
- <td>53</td>
-
- <td>4</td>
-
- <td>201.555.4433</td>
-
- <td>201 555 4433</td>
-
- <td>Love Nest</td>
-
- <td>Rex Cars</td>
-
- <td>Home</td>
- </tr>
- </tbody>
-</table>
-
-<p>Note that the query string isn't a standard SQL query string, but instead a
-URI string that describes the type of data to return. This URI consists of
-three parts: the string "content://"; a segment that describes what kind of
-data to retrieve; and finally an optional ID of a specific item of the
-specified content type. Here are a few more example query strings:</p>
-
-<ul>
- <li><strong>content://media/internal/images</strong> is the URI string that would return a list of all
- the internal images on the device.</li>
-
- <li><strong>content://media/external/images</strong> is the URI string that would return a list of all
- the images on the "primary" external storage (e.g., the SD card).</li>
-
- <li><strong>content://contacts/people/</strong> is the URI that would return a list of all contact names on the device.</li>
-
- <li><strong>content://contacts/people/23</strong> is the URI string that would return a single result row, the contact with ID = 23.</li>
-</ul>
-
-<p>Although there is a general form, these query URIs are somewhat arbitrary and
-confusing. Therefore, Android provides a list of helper classes in the {@link
-android.provider} package that
-define these query strings so you should not need to know the actual URI value
-for different data types. These helper classes define a string (actually,
-a {@link android.net.Uri Uri} object)
-called CONTENT_URI for a specific data type.</p>
-
-<p>Typically you will use the defined CONTENT_URI object to make a query,
-instead of writing the full URI yourself.
-So, each of the example query strings listed above (except for the last one that specifies the record ID)
- can be acquired with the following Uri references:</p>
-
-<ul>
- <li>{@link android.provider.MediaStore.Images.Media#INTERNAL_CONTENT_URI
- MediaStore.Images.Media.INTERNAL_CONTENT_URI}</li>
-
- <li>{@link android.provider.MediaStore.Images.Media#EXTERNAL_CONTENT_URI
- MediaStore.Images.Media.EXTERNAL_CONTENT_URI}</li>
-
- <li>{@link android.provider.Contacts.People#CONTENT_URI
- Contacts.People.CONTENT_URI}</li>
-</ul>
-
-<p>To query a specific record ID (e.g., content://contacts/people/23),
-you'll use the same CONTENT_URI, but must append the specific ID value that you want.
-This is one of the few times you should need to examine or modify the URI string.
-So, for example, if you were looking for record 23 in the people contacts, you might run a query
-as shown here:</p>
-<pre>
-// Get the base URI for contact with _ID=23.
-// This is same as Uri.parse("content://contacts/people/23");
-Uri myPerson = ContentUris.withAppendedId(People.CONTENT_URI, 23);
-// Query for this record.
-Cursor cur = managedQuery(myPerson, null, null, null);
-</pre>
-<p class="note"><strong>Tip:</strong> You can also append a string to a Uri, using
-{@link android.net.Uri#withAppendedPath(Uri,String)}.</p>
-
-<p>This query returns a cursor over a database query result set. What columns
-are returned, what they're called, and what they are named are discussed next.
-For now, though, know that you can specify that only certain columns be
-returned, the sort order, and a SQL WHERE clause.</p>
-
-<p>You should use the {@link
-android.app.Activity#managedQuery(android.net.Uri,java.lang.String[],java.lang.String,java.lang.String[],java.lang.String) Activity.managedQuery()}
-method to retrieve a managed cursor. A managed cursor handles all the niceties
-such as unloading itself when the application pauses, and requerying itself
-when the application restarts. You can ask Android to manage an unmanaged
-cursor for you by calling {@link
-android.app.Activity#startManagingCursor(android.database.Cursor) Activity.startManagingCursor()}.</p>
-
-<p>Let's look at an example query to retrieve a list of contact names and their primary phone
-numbers.</p>
-<pre>
-// An array specifying which columns to return.
-string[] projection = new string[] {
- People._ID,
- People.NAME,
- People.NUMBER,
-};
-
-// Get the base URI for People table in Contacts content provider.
-// ie. content://contacts/people/
-Uri mContacts = People.CONTENT_URI;
-
-// Best way to retrieve a query; returns a managed query.
-Cursor managedCursor = managedQuery( mContacts,
- projection, //Which columns to return.
- null, // WHERE clause--we won't specify.
- People.NAME + " ASC"); // Order-by clause.
-</pre>
-
-<p>This query will retrieve data from the people table of
-the Contacts content provider. It will retrieve the name, primary phone number, and unique record ID for
-each contact. </p>
-
-<p><strong>What the query returns</strong></p>
-
-<p>A query returns a set of zero or more database records. The column names,
-order, and type are specific to the content provider, but every query includes
-a column called _id, which is the ID of the item in that row. If a query can
-return binary data, such as a bitmap or audio file, it will have a column with
-any name that holds a content:// URI that you can use to get this data (more
-information on how to get the file will be given later). Here is a tiresome
-example result set for the previous query:</p>
-
-<table border="1">
- <tbody>
- <tr>
- <th scope="col">_id</th>
-
- <th scope="col">name</th>
-
- <th scope="col">number</th>
-
-
- </tr>
-
- <tr>
- <td>44</td>
-
- <td>Alan Vain</td>
-
- <td>212 555 1234</td>
-
-
- </tr>
-
- <tr>
- <td>13</td>
-
- <td>Bully Pulpit</td>
-
- <td>425 555 6677</td>
-
-
- </tr>
-
- <tr>
- <td>53</td>
-
- <td>Rex Cars</td>
-
- <td>201 555 4433</td>
-
-
- </tr>
- </tbody>
-</table>
-
-<p>This result set demonstrates what is returned when we specified a subset of
-columns to return. The optional subset list is passed in the
-<em>projection</em> parameter of the query. A content manager should list
-which columns it supports either by implementing a set of interfaces
-describing each column (see {@link
-android.provider.Contacts.People.Phones Contacts.People.Phones},
-which extends {@link android.provider.BaseColumns BaseColumns}, {@link
-android.provider.Contacts.PhonesColumns PhonesColumns}, and {@link
-android.provider.Contacts.PeopleColumns PeopleColumns}), or by
-listing the column names as constants. Note that you need to
-know the data type of a column exposed by a content provider in order to be
-able to read it; the field reading method is specific to the data type, and a
-column's data type is not exposed programmatically.</p>
-
-<p>The retrieved data is exposed by a {@link
-android.database.Cursor Cursor} object that can be used to
-iterate backward or forward through the result set. You can use this cursor to
-read, modify, or delete rows. Adding new rows requires a different object
-described later.</p>
-
-<p>Note that by convention, every recordset includes a field named _id, which
-is the ID of a specific record, and a _count field, which is a count of
-records in the current result set. These field names are defined by {@link
-android.provider.BaseColumns BaseColumns}.</p>
-
-<p><strong>Querying for Files</strong></p>
-
-<p>The previous query result demonstrates how a file is returned in a data
-set. The file field is typically (but not required to be) a string path to the
-file. However, the caller should never try to read and open the file directly
-(permissions problems for one thing can make this fail). Instead, you should
-call {@link
-android.content.ContentResolver#openInputStream(android.net.Uri) ContentResolver.openInputStream()}
-/ {@link
-android.content.ContentResolver#openOutputStream(android.net.Uri)
-ContentResolver.openOutputStream()},
-or one of the helper functions from a content provider.</p>
-
-<p><strong>Reading Retrieved Data</strong></p>
-
-<p>The Cursor object retrieved by the query provides access to a recordset of
-results. If you have queried for a specific record by ID, this set will
-contain only one value; otherwise, it can contain multiple values. You can
-read data from specific fields in the record, but you must know the data type
-of the field, because reading data requires a specialized method for each type
-of data. (If you call the string reading method on most types of columns,
-Android will give you the String representation of the data.) The Cursor lets
-you request the column name from the index, or the index number from the
-column name.</p>
-
-<p>If you are reading binary data, such as an image file, you should call
-{@link
-android.content.ContentResolver#openOutputStream(android.net.Uri) ContentResolver.openOutputStream()}
-on the string content:// URI stored in a column name.</p>
-
-<p>The following snippet demonstrates reading the name and phone number from
-our phone number query:</p>
-<pre>
-private void getColumnData(Cursor cur){
- if (cur.moveToFirst()) {
-
- String name;
- String phoneNumber;
- int nameColumn = cur.getColumnIndex(People.NAME);
- int phoneColumn = cur.getColumnIndex(People.NUMBER);
- String imagePath;
-
- do {
- // Get the field values
- name = cur.getString(nameColumn);
- phoneNumber = cur.getString(phoneColumn);
-
- // Do something with the values.
- ...
-
- } while (cur.moveToNext());
-
- }
-}
-</pre>
-
-<h3>Modifying Data<a name="modifyingdata" id="modifyingdata"></a></h3>
-
-<p>To batch update a group of records (for example, to change "NY" to "New
-York" in all contact fields), call the {@link
-android.content.ContentResolver#update(android.net.Uri,android.content.ContentValues,java.lang.String,java.lang.String[]) ContentResolver.update()}
-method with the columns and values to change.</p>
-
-<h3>Adding a New Record <a name="addingrecord" id="addingrecord"></a></h3>
-
-<p>To add a new record, call ContentResolver.insert() with the URI of the type
-of item to add, and a Map of any values you want to set immediately on the new
-record. This will return the full URI of the new record, including record
-number, which you can then use to query and get a Cursor over the new
-record.</p>
-
-<pre>
-ContentValues values = new ContentValues();
-Uri phoneUri = null;
-Uri emailUri = null;
-
-values.put(Contacts.People.NAME, "New Contact");
-//1 = the new contact is added to favorites
-//0 = the new contact is not added to favorites
-values.put(Contacts.People.STARRED,1);
-
-//Add Phone Numbers
-Uri uri = getContentResolver().insert(Contacts.People.CONTENT_URI, values);
-
-//The best way to add Contacts data like Phone, email, IM is to
-//get the CONTENT_URI of the contact just inserted from People's table,
-//and use withAppendedPath to construct the new Uri to insert into.
-phoneUri = Uri.withAppendedPath(uri, Contacts.People.Phones.CONTENT_DIRECTORY);
-
-values.clear();
-values.put(Contacts.Phones.TYPE, Phones.TYPE_MOBILE);
-values.put(Contacts.Phones.NUMBER, "1233214567");
-getContentResolver().insert(phoneUri, values);
-
-//Add Email
-emailUri = Uri.withAppendedPath(uri, ContactMethods.CONTENT_DIRECTORY);
-
-values.clear();
-//ContactMethods.KIND is used to distinguish different kinds of
-//contact data like email, im, etc.
-values.put(ContactMethods.KIND, Contacts.KIND_EMAIL);
-values.put(ContactMethods.DATA, "test@example.com");
-values.put(ContactMethods.TYPE, ContactMethods.TYPE_HOME);
-getContentResolver().insert(emailUri, values);
-
-</pre>
-
-<p>To save a file, you can call ContentResolver().openOutputStream() with the
-URI as shown in the following snippet:
-</p>
-<pre>
-// Save the name and description in a map. Key is the content provider's
-// column name, value is the value to save in that record field.
-ContentValues values = new ContentValues(3);
-values.put(MediaStore.Images.Media.DISPLAY_NAME, "road_trip_1");
-values.put(MediaStore.Images.Media.DESCRIPTION, "Day 1, trip to Los Angeles");
-values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg");
-
-// Add a new record without the bitmap, but with the values.
-// It returns the URI of the new record.
-Uri uri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
-
-try {
- // Now get a handle to the file for that record, and save the data into it.
- // sourceBitmap is a Bitmap object representing the file to save to the database.
- OutputStream outStream = getContentResolver().openOutputStream(uri);
- sourceBitmap.compress(Bitmap.CompressFormat.JPEG, 50, outStream);
- outStream.close();
-} catch (Exception e) {
- Log.e(TAG, "exception while writing image", e);
-}
-</pre>
-
-<h3>Deleting a Record <a name="deletingrecord" id="deletingrecord"></a></h3>
-
-<p>To delete a single record, call {@link
-android.content.ContentResolver#delete(android.net.Uri,java.lang.String,java.lang.String[]) ContentResolver.delete()}
-with the URI of a specific row.</p>
-
-<p>To delete multiple rows, call ContentResolver.delete() with the URI of the
-type of record to delete (for example,
-android.provider.Contacts.People.CONTENT_URI) and a SQL WHERE clause defining
-which rows to delete (<em>Warning</em>: be sure to include a valid WHERE
-clause if deleting a general type using ContentResolver.delete(), or else you
-risk deleting more records than you intended!).</p>
-
-<h2>Creating a Content Provider<a name="creatingacontentprovider"
-id="creatingacontentprovider"></a> </h2> <p>Here is how to create your own
-content provider to act as a public source for reading and writing a new data
-type:</p>
-<ol>
- <li>Extend
- {@link android.content.ContentProvider ContentProvider}.</li>
- <li>Define a <code>public static final {@link android.net.Uri Uri} </code>named
- CONTENT_URI. This is the string that represents the full "content://" URI
- that your content provider handles. You must define a unique string for this
- value; the best solution is to use the fully-qualified class name of your
- content provider (lowercase). So, for example: <br>
-
- <code>public static final Uri CONTENT_URI = Uri.parse(
- "content://com.google.codelab.rssprovider");</code></li>
- <li>Create your system for storing data. Most content providers store their
- data using Android's file storage methods or SQLite databases, but you can
- store your data any way you want, so long as you follow the calling and return
- value conventions.</li>
- <li>Define the column names that you will return to your clients. If you are
- using an underlying database, these column names are typically identical
- to the SQL database column names they represent. In any case, you should include
- an integer column named <code>_id</code> to
- define a specific record number. If using the SQLite database, this should
- be type <code>INTEGER
- PRIMARY KEY AUTOINCREMENT</code>.
- The <code>AUTOINCREMENT</code> descriptor
- is optional, but by default, SQLite
- autoincrements an ID counter field to the next number above the largest
- existing number in the table. If you delete the last row, the next row added
- will have the same ID as the deleted row. To avoid this by having SQLite
- increment to the next largest value whether deleted or not, then assign your
- ID column the following type: INTEGER PRIMARY KEY AUTOINCREMENT. (<strong>Note</strong> You
- should have a unique _id field whether or not you have another field (such
- as a URL) that is also unique among all records.) Android provides the
- {@link android.database.sqlite.SQLiteOpenHelper SQLiteOpenHelper}
-
- class to help you create and manage versions of your database. </li>
- <li>If you are exposing byte data, such as a bitmap file, the field that stores
- this data should actually be a string field with a content:// URI for that
- specific file. This is the field that clients will call to retrieve this
- data. The content provider for that content type (it can be the same content
- provider or another content provider &mdash; for example, if you're storing a photo
- you would use the media content provider) should implement a field named
- _data for that record. The _data field lists the exact file path on the device
- for that file. This field is not intended to be read by the client, but by
- the ContentResolver. The client will call {@link
- android.content.ContentResolver#openOutputStream(android.net.Uri) ContentResolver.openOutputStream()} on the user-facing field holding the URI
- for the item (for example, the column named photo might have a value content://media/images/4453).
- The ContentResolver will request the _data field for that record, and because
- it has higher permissions than a client, it should be able to access
- that file directly and return a read wrapper for that file to the client. </li>
- <li>Declare public static
- Strings that clients can use to specify which columns to return, or to specify
- field values from the cursor. Carefully document the data type of each
- field. Remember that file fields, such as audio or bitmap fields, are typically
- returned as string path values </li>
- <li>Return a {@link android.database.Cursor Cursor} object over a recordset in
- reply to a query. This means implementing the query(), update(), insert(),
- and delete() methods. As a courtesy, you might want to call {@link android.content.ContentResolver#notifyChange(android.net.Uri,android.database.ContentObserver) ContentResolver.notifyChange()} to notify
- listeners about updated information. </li>
-
- <li>Add a <code>&lt;provider&gt;</code> tag to AndroidManifest.xml, and use its
- <em>authorities</em> attribute to define the authority part of the content type it should
- handle. For example, if your content type is content://com.example.autos/auto
- to request a list of all autos, then <em>authorities</em> would be <code>com.example.autos</code>.
- Set the <em>multiprocess</em> attribute to true if data does not need to
- be synchronized between multiple running versions of the content provider. </li>
-
- <li>If you are handling a new data type, you must define a new MIME type to return
- for your implementation of {@link android.content.ContentProvider#getType(android.net.Uri) android.ContentProvider.getType(url)}. This type corresponds to the <code>content://</code> URI
- submitted to getType(), which will be one of the content types handled by
- the provider. The MIME type for each content type has two forms: one for
- a specific record, and one for multiple records. Use the {@link android.net.Uri Uri} methods to help determine what is being requested. Here is
- the general format for each:
-<ul>
-<li><code>vnd.android.cursor.item/vnd.<em>yourcompanyname.contenttype</em></code>
-for a single row. For example, a request for train record 122 using
-<pre>content://com.example.transportationprovider/trains/122</pre>
-might return the MIME type
-<code>vnd.android.cursor.item/vnd.example.rail</code>
-</li>
-<li><code>vnd.android.cursor.dir/vnd.<em>yourcompanyname.contenttype</em></code>
-for multiple rows. For example, a request for all train records using
-<pre>content://com.example.transportationprovider/trains</pre>
-might return the MIME type
-<code>vnd.android.cursor.dir/vnd.example.rail</code>
-</li>
-</ul>
-
- </li>
-</ol>
-<p>For an example of a private content provider implementation, see the NodePadProvider
- class in the notepad sample application that ships with the SDK. </p>
-<p>Here is a recap of the important parts of a content URI:</p>
-<p><img src="../../images/content_uri.png" alt="Elements of a content URI" height="80" width="528"> </p>
-<ol type="A">
- <li>Standard required prefix. Never modified. </li>
- <li>Authority part. For third-party applications, this should be a fully-qualified
- class to ensure uniqueness. This corresponds to the value in
- the <code>&lt;provider&gt;</code> element's <em>authorities</em> attribute:
- <code>&lt;provider class="TransportationProvider"
- authorities="com.example.transportationprovider"
- /&gt;</code> </li>
-
- <li>The path that the content provider uses to determine what kind of data is
- being requested. This can be zero or more segments: if the content provider
- exposes only one type of data (only trains, for example), this can be absent.
- If it provides several types, including subtypes, this can be several elements
- long: e.g., "<code>land/bus</code>, <code>land/train</code>, <code>sea/ship</code>,
- and <code>sea/submarine</code>" to give four possibilities.</li>
- <li>A specific record being requested, if any. This is the _id value of a specific
- record being requested. If all records of a specific type are being requested,
- omit this and the trailing slash: <code>content://com.example.transportationprovider/trains</code> </li>
-</ol>
-
diff --git a/docs/html/guide/topics/data/data-storage.jd b/docs/html/guide/topics/data/data-storage.jd
index 2b3491c..0a1ee02 100644
--- a/docs/html/guide/topics/data/data-storage.jd
+++ b/docs/html/guide/topics/data/data-storage.jd
@@ -1,16 +1,45 @@
page.title=Data Storage
@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>Storage quickview</h2>
+ <ul>
+ <li>Fast, lightweight storage through system preferences</li>
+ <li>File storage to device internal or removable flash</li>
+ <li>Arbitrary and structured storage in databases</li>
+ <li>Support for network-based storage</li>
+ </ul>
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#pref">Preferences</a></li>
+ <li><a href="#files">Files</a></li>
+ <li><a href="#db">Databases</a></li>
+ <li><a href="#netw">Network</a></li>
+ </ol>
+
+ <h2>See also</h2>
+ <ol>
+ <li><a href="#pref">Content Providers and Content Resolvers</a></li>
+ </ol>
+
+</div>
+</div>
+
<p>
A typical desktop operating system provides a common file system that any
application can use to store files that can be read by other
applications (perhaps with some access control settings). Android uses a
different system: On Android, all application data (including files) are
private to that application.
+</p>
<p>
However, Android also provides a standard way for an application to expose
-its private data to other applications &mdash; through a content providers.
+its private data to other applications &mdash; through content providers.
A content provider is an
optional component of an application that exposes read/write access to the
application's data, subject to whatever restrictions it might impose.
@@ -19,23 +48,19 @@ data, and a standard mechanism for reading the returned data. Android supplies
a number of content providers for standard data types, such as image, audio,
and video files and personal contact information. For more information on
using content providers, see a separate document,
-<a href="{@docRoot}devel/data/contentproviders.html">Content Providers</a>.
+<a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>.
+</p>
<p>
Whether or not you want to export your application's data to others,
you need a way to store it. Android provides the following four mechanisms
-for storing and retrieving data:
-
-<dl>
-<dd><a href="#pref">Preferences</a>
-<dd><a href="#files">Files</a>
-<dd><a href="#db">Databases</a>
-<dd><a href="#netw">Network</a>
-</dl>
-
-<dl>
-<dt><a name="pref"></a><b>Preferences</b></dt>
-<dd>A lightweight mechanism to store and retrieve key-value pairs of primitive
+for storing and retrieving data: <a href="#pref">Preferences</a>,
+<a href="#files">Files</a>, <a href="#db">Databases</a>, and <a href="#netw">Network</a>.
+</p>
+
+
+<h2 id="pref">Preferences</h2>
+<p>Preferences is a lightweight mechanism to store and retrieve key-value pairs of primitive
data types. It is typically used to store application preferences, such as a
default greeting or a text font to be loaded whenever the application is started. Call
<code>{@link android.content.Context#getSharedPreferences(java.lang.String,int)
@@ -44,11 +69,13 @@ your set of preferences if you want to share them with other components in the s
application, or use <code>{@link android.app.Activity#getPreferences(int)
Activity.getPreferences()}</code> with no name to keep them private to the calling
activity. You cannot share preferences across applications (except by using a
-content provider).
+content provider).
+</p>
<p>
Here is an example of setting user preferences for silent keypress mode for a
calculator:
+</p>
<pre>
import android.app.Activity;
@@ -84,12 +111,13 @@ public static final String PREFS_NAME = "MyPrefsFile";
editor.commit();
}
}
-</pre></dd>
+</pre>
-<p>
-<dt><a name="files"></a><b>Files</b></dt>
-<dd>You can store files directly on the mobile device or on a removable
+
+<h2 id="files">Files</h2>
+<p>You can store files directly on the mobile device or on a removable
storage medium. By default, other applications cannot access these files.
+</p>
<p>
To read data from a file, call {@link android.content.Context#openFileInput
@@ -100,6 +128,7 @@ Context.openFileOutput()} with the name and path. It returns a {@link
java.io.FileOutputStream} object. Calling these methods with name and path
strings from another application will not work; you can only access local
files.
+</p>
<p>
If you have a static file to package with your application at compile time,
@@ -108,11 +137,12 @@ and then open it with {@link
android.content.res.Resources#openRawResource(int) Resources.openRawResource
(R.raw.<em>myDataFile</em>)}. It returns an {@link java.io.InputStream}
object that you can use to read from the file.
-</dd>
+</p>
-<dt><a name="db"></a><b>Databases</b></dt>
-<dd>The Android API contains support for creating and using SQLite databases.
+<h2 id="db">Databases</h2>
+<p>The Android API contains support for creating and using SQLite databases.
Each database is private to the application that creates it.
+</p>
<p>
The {@link android.database.sqlite.SQLiteDatabase} object represents a database
@@ -120,6 +150,7 @@ and has methods for interacting with it &mdash; making queries and managing the
data. To create the database, call <code>{@link
android.database.sqlite.SQLiteDatabase#create SQLiteDatabase.create()}</code>
and also subclass {@link android.database.sqlite.SQLiteOpenHelper}.
+</p>
<p>
As part of its support for the SQLite database system, Android exposes
@@ -128,16 +159,19 @@ wrapped into useful objects. For example, Android defines a data type
for contact information; it consists of many fields including a first and last
name (strings), an address and phone numbers (also strings), a photo (bitmap
image), and much other information describing a person.
+</p>
<p>
Android ships with the sqlite3 database tool, which enables you to browse
table contents, run SQL commands, and perform other useful functions on SQLite
-databases. See <a href="{@docRoot}reference/adb.html#sqlite">Examine databases
+databases. See <a href="{@docRoot}guide/developing/tools/adb.html#sqlite">Examine databases
(sqlite3)</a> to learn how to run this program.
+</p>
<p>
All databases, SQLite and others, are stored on the device in
<code>/data/data/<em>package_name</em>/databases</code>.
+</p>
<p>
Discussion of how many tables to create, what fields they contain, and how
@@ -146,21 +180,20 @@ impose any limitations beyond the standard SQLite concepts. We do recommend
including an autoincrement value key field that can be used as a unique ID to
quickly find a record. This is not required for private data, but if you
implement a content provider, you must include such a unique ID field. See the
-<a href="{@docRoot}devel/data/contentproviders.html">Content Providers</a>
+<a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>
document for more information on this field and the NotePadProvider class
in the NotePad sample code for an example of creating and populating a
new database. Any databases you create will be accessible by name to any other
-class in the application, but not outside the application.</p>
-</dd>
-
-<dt><a name="netw"></a><b>Network</b></dt>
-<dd>You can also use the network to store and retrieve data (when it's available).
-To do network operations, use the classes in the following packages:
-<dl>
- <dd><code>{@link java.net java.net.*}</code></dd>
- <dd><code>{@link android.net android.net.*}</code></dd>
-</dl>
-</dd>
-
-</dl>
+class in the application, but not outside the application.
+</p>
+
+
+<h2 id="netw">Network</h2>
+<p>You can also use the network to store and retrieve data (when it's available).
+To do network operations, use the classes in the following packages:</p>
+
+<ul class="no-style">
+ <li><code>{@link java.net java.net.*}</code></li>
+ <li><code>{@link android.net android.net.*}</code></li>
+</ul>
diff --git a/docs/html/guide/topics/data/index.html b/docs/html/guide/topics/data/index.html
new file mode 100644
index 0000000..a94f8c0
--- /dev/null
+++ b/docs/html/guide/topics/data/index.html
@@ -0,0 +1,9 @@
+<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/drawing/index.html b/docs/html/guide/topics/drawing/index.html
new file mode 100644
index 0000000..43c1499
--- /dev/null
+++ b/docs/html/guide/topics/drawing/index.html
@@ -0,0 +1,9 @@
+<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/fundamentals.jd b/docs/html/guide/topics/fundamentals.jd
new file mode 100644
index 0000000..7118ceb
--- /dev/null
+++ b/docs/html/guide/topics/fundamentals.jd
@@ -0,0 +1,1411 @@
+page.title=Application Fundamentals
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>Key classes</h2>
+<ol>
+<li>{@link android.app.Activity}</li>
+<li>{@link android.app.Service}</li>
+<li>{@link android.content.BroadcastReceiver}</li>
+<li>{@link android.content.ContentProvider}</li>
+<li>{@link android.content.Intent}</li>
+</ol>
+
+<h2>In this document</h2>
+<ol>
+<li><a href="#appcomp">Application Components</a>
+ <ol>
+ <li><a href="#actcomp">Activating components: intents</a></li>
+ <li><a href="#manfile">The manifest file</a></li>
+ <li><a href="#ifilters">Intent filters</a></li>
+ </ol></li>
+<li><a href="#acttask">Activities and Tasks</a>
+ <ol>
+ <li><a href="#afftask">Affinities and new tasks</a></li>
+ <li><a href="#lmodes">Launch modes</a></li>
+ <li><a href="#clearstack">Clearing the stack</a></li>
+ <li><a href="#starttask">Starting tasks</a></li>
+ </ol></li>
+<li><a href="#procthread">Processes and Threads</a></li>
+<li><a href="#lcycles">Lifecycles</a>
+ <ol>
+ <li><a href="#actlife">Activity lifecycle</a></li>
+ <li><a href="#servlife">Service lifecycle</a></li>
+ <li><a href="#broadlife">Broadcast receiver lifecycle</a></li>
+ <li><a href="#proclife">Processes and lifecycles</a></li>
+ </ol></li>
+</div>
+</div>
+
+<p>
+Android applications are written in the Java programming language.
+The compiled Java code &mdash; along with data and
+resource files required by the application and a manifest describing the
+application &mdash; is bundled by the aapt tool into an <i>Android package</i>,
+an archive file marked by an {@code .apk} suffix. This file is the vehicle
+for distributing the application and installing it on mobile devices; it's
+the file users download to their devices. All the code in a single
+{@code .apk} file is considered to be one <i>application</i>.
+</p>
+
+<p>
+In many ways, each Android application lives in its own world:
+</p>
+
+<ul>
+<li>By default, every application runs in its own Linux process.
+Android starts the process when any of the application's code needs to be
+executed, and shuts down the process when it's no longer needed and system
+resources are required by other applications.</li>
+
+<li>Each process has its own Java virtual machine (VM), so application code
+runs in isolation from the code of all other applications.</li>
+
+<li>By default, each application is assigned a unique Linux user ID.
+Permissions are set so that the application's files are visible only
+that user, only to the application itself &mdash; although there are ways
+to export them to other applications as well.</li>
+</ul>
+
+<p>
+It's possible to arrange for two applications to share the same user ID,
+in which case they will be able to see each other's files. To conserve
+system resources, applications with the same ID can also arrange to run
+in the same Linux process, sharing the same VM.
+</p>
+
+
+<h2><a name="appcomp"></a>Application Components</h2>
+
+<p>
+A central feature of Android is that one application can make use of elements
+of other applications (provided those applications permit it). For example,
+if your application needs to display a scrolling list of images and another
+application has developed a suitable scroller and made it available to others,
+you can call upon that scroller to do the work, rather than develop your own.
+Your application doesn't incorporate the code of the other application or
+link to it. Rather, it simply starts up that piece of the other application
+when the need arises.
+</p>
+
+<p>
+For this to work, the system must be able to start an application process
+when any part of it is needed, and instantiate the Java objects for that part.
+Therefore, unlike applications on most other systems, Android applications don't
+have a single entry point for everything in the application (no {@code main()}
+function, for example). Rather, they have essential <i>components</i> that
+the system can instantiate and run as needed. There are four types of components:
+</p>
+
+<dl>
+
+<dt><b>Activities</b></dt>
+<dd>An <i>activity</i> presents a visual user interface for one focused endeavor
+the user can undertake. For example, an activity might present a list of
+menu items users can choose from or it might display photographs along
+with their captions. A text messaging application might have one activity
+that shows a list of contacts to send messages to, a second activity to write
+the message to the chosen contact, and other activities to review old messages
+or change settings. Though they work together to form a cohesive user interface,
+each activity is independent of the others.
+Each one is implemented as a subclass of the {@link android.app.Activity} base class.
+
+<p>
+An application might consist of just one activity or, like the text messaging
+application just mentioned, it may contain several.
+What the activities are, and how many there are depends, of course, on the
+application and its design. Typically, one of the activities is marked
+as the first one that should be presented to the user when the application is
+launched. Moving from one activity to another is accomplished by having the
+current activity start the next one.
+</p>
+
+<p>
+Each activity is given a default window to draw in. Typically, the window
+fills the screen, but it might be smaller than the screen and float on top
+of other windows. An activity can also make use of additional windows &mdash;
+for example, a window that presents users with vital information when they
+select a particular item on-screen, or a pop-up dialog that calls for a user
+response in the midst of the activity.
+</p>
+
+<p>
+The visual content of the window is provided by a hierarchy of views &mdash;
+objects derived from the base {@link android.view.View} class. Each view
+draws in a particular rectangular space within the window and responds to user
+actions directed at that space. Android has a number of ready-made views that
+you can use &mdash; including buttons, text fields, scroll bars, menu items,
+check boxes, and more. A view hierarchy is placed within the activity's
+window by the <code>{@link android.app.Activity#setContentView
+Activity.setContentView()}</code> method. The <i>content view</i>
+is the View object at the root of the hierarchy.
+(See <a href="{@docRoot}guide/topics/views/index.html">Views and Layout</a>
+for more information on views and the heirarchy.)
+</p></dd>
+
+<p><dt><b>Services</b></dt>
+<dd>A <i>service</i> doesn't have a visual user interface, but rather runs in
+the background for an indefinite period of time. For example, a service might
+play background music as the user attends to other matters, or it might fetch
+data over the network or calculate something and provide the result to activities
+that need it. Each service extends the {@link android.app.Service} base class.
+
+<p>
+A good example is a media player playing songs from a play list. The player
+application would probably have one or more activities that allow the user to
+choose songs and start playing them. However, the music playback itself would
+not be handled by an activity because users will expect the music to keep
+playing even after they leave the player and begin something different.
+To keep the music going, the media player activity could start a service to run
+in the background. The system will then keep the music playback service running
+even after the activity that started it leaves the screen.
+</p>
+
+<p>
+It's possible to connect to (bind to) an ongoing service (and start the service
+if it's not already running). While connected, you can communicate with the
+service through an interface that the service exposes. For the music service,
+this interface might allow users to pause, rewind, stop, and restart the playback.
+</p>
+
+<p>
+Like activities and the other components, services run in the main thread of
+the application process. So that they won't block other components or the
+user interface, they often spawn another thread for time-consuming tasks
+(like music playback). See <a href="#procthread">Processes and Threads</a>, later.
+</p></dd>
+
+<dt><b>Broadcast receivers</b></dt>
+<dd>A <i>broadcast receiver</i> is a component that does nothing but
+receive and react to broadcast announcements. Many broadcasts originate in
+system code &mdash; for example, announcements that the timezone has changed,
+that the battery is low, that the keyboard has been exposed, or that the user
+changed a language preference.
+
+<p>
+An application can have any number of broadcast receivers to respond to any
+announcements it considers important. All receivers extend the {@link
+android.content.BroadcastReceiver} base class.
+</p>
+
+<p>
+Broadcast receivers do not display a user interface. However, they may start
+an activity in response to the information they receive, or they may use
+the {@link android.app.NotificationManager} to alert the user. Notifications
+can get the user's attention in various ways &mdash; flashing
+the backlight, vibrating the device, playing a sound, and so on. They
+typically place a persistent icon in the status bar, which users can open to
+get the message.
+</p></dd>
+
+<dt><b>Content providers</b></dt>
+<dd>A <i>content provider</i> makes a specific set of the application's data
+available to other applications. The data can be stored in the file system,
+in an SQLite database, or in any other manner that makes sense.
+The content provider extends the {@link android.content.ContentProvider} base
+class to implement a standard set of methods that enable other applications
+to retrieve and store data of the type it controls. However, applications
+do not call these methods directly. Rather they use a {@link
+android.content.ContentResolver} object and call its methods instead.
+A ContentResolver can talk to any content provider; it cooperates with the
+provider to manage any interprocess communication that's involved.
+
+<p>
+See the separate
+<a href="{@docRoot}guide/topics/providers/content-providers.html">Content
+Providers</a> document for more information on using content providers.
+</p></dd>
+
+</dl>
+
+<p>
+Whenever there's a request that should be handled by a particular component,
+Android makes sure that the application process of the component is running,
+starting it if necessary, and that an appropriate instance of the component
+is available, creating the instance if necessary.
+</p>
+
+
+<h3><a name="actcomp"></a>Activating components: intents</h3>
+
+<p>
+Content providers are activated when they're targeted by a request from a
+ContentResolver. The other three components &mdash; activities, services,
+and broadcast receivers &mdash; are activated by asynchronous messages
+called <i>intents</i>. An intent is an {@link android.content.Intent}
+object that holds the content of the message. Among other things, it names
+the action an activity or service is being requested to take and specifies
+the URI of the data to act on. For broadcast receivers, it names the
+action being announced. For example, it might convey a request for
+an activity to present an image to the user or let the user edit some
+text. Or it might announce to interested broadcast receivers that the
+camera button has been pressed.
+</p>
+
+<p>
+There are separate methods for activiating each type of component:
+</p>
+
+<ul>
+
+<li>An activity is launched (or given something new to do) by passing an
+Intent object to <code>{@link android.content.Context#startActivity
+Context.startActivity()}</code> or <code>{@link
+android.app.Activity#startActivityForResult
+Activity.startActivityForResult()}</code>. The responding activity can
+look at the initial intent that caused it to be launched by calling its
+<code>{@link android.app.Activity#getIntent getIntent()}</code> method.
+Android calls the activity's <code>{@link
+android.app.Activity#onNewIntent onNewIntent()}</code> method to pass
+it any subsequent intents.
+
+<p>
+One activity often starts the next one. If it expects a result back from
+the activity it's starting, it calls {@code startActivityForResult()}
+instead of {@code startActivity()}. For example, if it starts an activity
+that lets the user pick a photo, it might expect to be returned the chosen
+photo. The result is returned in an Intent object that's passed to the
+calling activity's <code>{@link android.app.Activity#onActivityResult
+onActivityResult()}</code> method.
+</p>
+</li>
+
+<li><p>A service is started (or new instructions are given to an ongoing
+service) by passing an Intent object to <code>{@link
+android.content.Context#startService Context.startService()}</code>.
+Android calls the service's <code>{@link android.app.Service#onStart
+onStart()}</code> method and passes it the Intent object.</p>
+
+<p>
+Similarly, an intent can be passed to <code>{@link
+android.content.Context#bindService Context.bindService()}</code> to
+establish an ongoing connection between the calling component and a
+target service. It initiates the service if it's not already running.
+The service receives the Intent object in
+an <code>{@link android.app.Service#onBind onBind()}</code> call.
+For example, an activity might establish a connection with the music
+playback service mentioned earlier so that it could provide the user
+with an interface for controlling the playback. The activity would
+call {@code bindService()} to set up that connection.
+</p>
+</li>
+
+<li><p>An application can initiate a broadcast by passing an Intent object to
+methods like <code>{@link
+android.content.Context#sendBroadcast(Intent) Context.sendBroadcast()}</code>,
+<code>{@link android.content.Context#sendOrderedBroadcast(Intent, String)
+Context.sendOrderedBroadcast()}</code>, and <code>{@link
+android.content.Context#sendStickyBroadcast Context.sendStickyBroadcast()}</code>
+in any of their variations. Android delivers the intent to all interested
+broadcast receivers by calling their <code>{@link
+android.content.BroadcastReceiver#onReceive onReceive()}</code> methods.</p></li>
+
+</ul>
+
+<p>
+For more on intent messages, see the separate article, <a
+href="{@docRoot}guide/topics/intents/intents-filters.html">Intents
+and Intent Filters</a>.
+
+
+<h3><a name="manfile"></a>The manifest file</h3>
+
+<p>
+Before Android can start an application component, it must learn that
+the component exists. Therefore, applications declare their components
+in a manifest file that's bundled into the Android package, the {@code .apk}
+file that also holds the application's code, files, and resources.
+</p>
+
+<p>
+The manifest is a structured XML file and is always named AndroidManifest.xml
+for all applications. It does a number of things in addition to declaring the
+application's components, such as naming any libraries the application needs
+to be linked against (besides the default Android library) and identifying
+any permissions the application expects to be granted.
+</p>
+
+<p>
+But the principal task of the manifest is to inform Android about the application's
+components. For example, an activity might be declared as follows:
+</p>
+
+<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;manifest . . . &gt;
+ &lt;application . . . &gt;
+ &lt;activity android:name="com.example.project.FreneticActivity"
+ android:icon="@drawable/small_pic.png"
+ android:label="@string/freneticLabel"
+ . . . &gt;
+ &lt;/activity&gt;
+ . . .
+ &lt;/application&gt;
+&lt/manifest&gt;</pre>
+
+<p>
+The {@code name} attribute of the {@code &lt;activity&gt;} element
+names the {@link android.app.Activity} subclass that implements the
+activity. The {@code icon} and {@code label} attributes point to
+resource files containing an icon and label that can be displayed
+to users to represent the activity.
+</p>
+
+<p>
+The other components are declared in a similar way &mdash;
+{@code &lt;service&gt;} elements for services, {@code &lt;receiver&gt;}
+elements for broadcast receivers, and {@code &lt;provider&gt;} elements
+for content providers. Activities, services, and content providers that
+are not declared in the manifest are not visible to the system and are
+consequently never run. Broadcast receivers can be declared in the
+manifest, or they can be created dynamically in code (as
+{@link android.content.BroadcastReceiver} objects)
+and registered with the system by calling <code>{@link
+android.content.Context#registerReceiver Context.registerReceiver()}</code>.
+</p>
+
+<p>
+For more on how to structure a manifest file for your application, see
+<a href="{@docRoot}guide/topics/manifest/manifest.html">The Manifest File</a>.
+</p>
+
+
+<h3><a name="ifilters"></a>Intent filters</h3>
+
+<p>
+An Intent object can explicitly name a target component. If it does,
+Android finds that component (based on the declarations in the manifest
+file) and activates it. But if a target is not explicitly named,
+Android must locate the best component to respond to the intent.
+It does so by comparing the Intent object to the <i>intent filters</i>
+of potential targets. A component's intent filters inform Android of
+the kinds of intents the component is able to handle. Like other
+essential information about the component, they're declared in the
+manifest file. Here's an extension of the previous example that adds
+two intent filters to the activity:
+</p>
+
+<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;manifest . . . &gt;
+ &lt;application . . . &gt;
+ &lt;activity android:name="com.example.project.FreneticActivity"
+ android:icon="@drawable/small_pic.png"
+ android:label="@string/freneticLabel"
+ . . . &gt;
+ &lt;intent-filter . . . &gt;
+ &lt;action android:name="android.intent.action.MAIN" /&gt;
+ &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
+ &lt;/intent-filter&gt;
+ &lt;intent-filter . . . &gt;
+ &lt;action android:name="com.example.project.BOUNCE" /&gt;
+ &lt;data android:type="image/jpeg" /&gt;
+ &lt;category android:name="android.intent.category.DEFAULT" /&gt;
+ &lt;/intent-filter&gt;
+ &lt;/activity&gt;
+ . . .
+ &lt;/application&gt;
+&lt/manifest&gt;</pre>
+
+<p>
+The first filter in the example &mdash; the combination of the action
+"{@code android.intent.action.MAIN}" and the category
+"{@code android.intent.category.LAUNCHER}" &mdash; is a common one.
+It marks the activity as one that should be represented in the
+application launcher, the screen listing applications users can launch
+on the device. In other words, the activity is the entry point for
+the application, the initial one users would see when they choose
+the application in the launcher.
+</p>
+
+<p>
+The second filter declares an action that the activity can perform on
+a particular type of data.
+</p>
+
+<p>
+A component can have any number of intent filters, each one declaring a
+different set of capabilities. If it doesn't have any filters, it can
+be activated only by intents that explicitly name the component as the
+target.
+</p>
+
+<p>
+For a broadcast receiver that's created and registered in code, the
+intent filter is instantiated directly as an {@link android.content.IntentFilter}
+object. All other filters are set up in the manifest.
+</p>
+
+<p>
+For more on intent filters, see a separate document,
+<a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents
+and Intent Filters</a>.
+</p>
+
+
+<h2><a name="acttask"></a>Activities and Tasks</h2>
+
+<p>
+As noted earlier, one activity can start another, including one defined
+in a different application. Suppose, for example, that you'd like
+to let users display a street map of some location. There's already an
+activity that can do that, so all your activity needs to do is put together
+an Intent object with the required information and pass it to
+{@code startActivity()}. The map viewer will display the map. When the user
+hits the BACK key, your activity will reappear on screen.
+</p>
+
+<p>
+To the user, it will seem as if the map viewer is part of the same application
+as your activity, even though it's defined in another application and runs in
+that application's process. Android maintains this user experience by keeping
+both activities in the same <i>task</i>. Simply put, a task is what the user
+experiences as an "application." It's a group of related activities, arranged
+in a stack. The root activity in the stack is the one that began the task
+&mdash; typically, it's an activity the user selected in the application launcher.
+The activity at the top of the stack is one that's currently running &mdash;
+the one that is the focus for user actions. When one activity starts another,
+the new activity is pushed on the stack; it becomes the running activity.
+The previous activity remains in the stack. When the user presses the BACK key,
+the current activity is popped from the stack, and the previous one resumes as
+the running activity. Activities in the stack are never rearranged, only
+pushed and popped.
+</p>
+
+<p>
+The stack contains objects, so if a task has more than one instance of the same
+Activity subclass open &mdash; multiple map viewers, for example &mdash; the
+stack has a separate entry for each instance.
+</p>
+
+<p>
+A task is a stack of activities, not a class or an element in the manifest file.
+So there's no way to set values for a task independently of its activities.
+Values for the task as a whole are set in the root activity. For example, the
+next section will talk about the "affinity of a task"; that value is read from
+the affinity set for the task's root activity.
+</p>
+
+<p>
+All the activities in a task move together as a unit. The entire task (the entire
+activity stack) can be brought to the foreground or sent to the background.
+Suppose, for instance, that the current task has four activities in its stack
+&mdash; three under the current activity. The user presses the HOME key, goes
+to the application launcher, and selects a new application (actually, a new <i>task</i>).
+The current task goes into the background and the root activity for the new task is displayed.
+Then, after a short period, the user goes back to the home screen and again selects
+the previous application (the previous task). That task, with all four
+activities in the stack, comes forward. When the user presses the BACK
+key, the screen does not display the activity the user just left (the root
+activity of the previous task). Rather, the activity on the top of the stack
+is removed and the previous activity in the same task is displayed.
+</p>
+
+<p>
+The behavior just described is the default behavior for activities and tasks.
+But there are ways to modify almost all aspects of it. The association of
+activities with tasks, and the behavior of an activity within a task, is
+controlled by the interaction between flags set in the Intent object that
+started the activity and attributes set in the activity's {@code &lt;activity&gt;}
+element in the manifest. Both requester and respondent have a say in what happens.
+</p>
+
+<p>
+In this regard, the principal Intent flags are:
+
+<p style="margin-left: 2em">{@code FLAG_ACTIVITY_NEW_TASK}
+<br/>{@code FLAG_ACTIVITY_CLEAR_TOP}
+<br/>{@code FLAG_ACTIVITY_RESET_TASK_IF_NEEDED}
+<br/>{@code FLAG_ACTIVITY_SINGLE_TOP}</p>
+
+<p>
+The principal {@code &lt;activity&gt;} attributes are:
+
+<p style="margin-left: 2em">{@code taskAffinity}
+<br/>{@code launchMode}
+<br/>{@code allowTaskReparenting}
+<br/>{@code clearTaskOnLaunch}
+<br/>{@code alwaysRetainTaskState}
+<br/>{@code finishOnTaskLaunch}</p>
+
+<p>
+The following sections describe what some of these flags and attributes do,
+and how they interact.
+</p>
+
+
+<h3><a name="afftask"></a>Affinities and new tasks</h3>
+
+<p>
+By default, all the activities in an application have an <i>affinity</i> for each
+other &mdash; that is, there's a preference for them all to belong to the
+same task. However, an individual affinity can be set for each activity
+with the {@code taskAffinity} attribute. Activities defined in different
+applications can share an affinity, or activities defined in the same
+application can be assigned different affinities.
+The affinity comes into play in two circumstances: When the Intent object
+that launches an activity contains the {@code FLAG_ACTIVITY_NEW_TASK} flag,
+and when an activity has its {@code allowTaskReparenting} attribute set
+to "{@code true}".
+</p>
+
+<dl>
+<dt>The <code>{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK}</code> flag</dt>
+<dd>As mentioned earlier, a new activity is, by default, launched into
+the task of the activity that called {@code startActivity()}. It's pushed
+ onto the same stack as the caller. However, if the Intent object passed
+to {@code startActivity()} contains the {@code FLAG_ACTIVITY_NEW_TASK}
+flag, the system looks for a different task to house the new activity.
+Often, as the name of the flag implies, it's a new task. However, it
+doesn't have to be. If there's 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.</dd>
+
+<dt>The {@code allowTaskReparenting} attribute</dt>
+<dd>If an activity has its {@code allowTaskReparenting} attribute is
+set to "{@code true}", it can move from the task it starts in to the task
+it has an affinity for when that task comes to the fore. 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
+affinity) and it allows reparenting. One of your activities
+starts the weather reporter, so it initially belongs to the same task as
+your activity. However, when the travel application, next comes forward,
+the weather reporter will be reassigned to and displayed with that task.</dd>
+</dl>
+
+<p>
+If an {@code .apk} file contains more than one "application"
+from the user's point of view, you will probably want to assign different
+affinities to the activities associated with each of them.
+</p>
+
+
+<h3><a name="lmodes"></a>Launch modes</h3>
+
+<p>
+There are four different launch modes that can be assigned to an {@code
+&lt;activity&gt;} element's {@code launchMode} attribute:
+</p>
+
+<p style="margin-left: 2em">"{@code standard}" (the default value)
+<br>"{@code singleTop}"
+<br>"{@code singleTask}"
+<br>"{@code singleInstance}"</p>
+
+<p>
+The launch mode determines three things:
+</p>
+
+<ul>
+<li>Whether the activity can belong to a task that includes other
+activities. The answer is yes for all the modes except
+"{@code singleInstance}". A "{@code singleInstance}" activity is always
+the only activity in its task. If it tries to launch another activity,
+that activity is assigned to a different task &mdash; as if {@code
+FLAG_ACTIVITY_NEW_TASK} was in the intent.</li>
+
+<li><p>Whether the activity always begins a task. For "{@code singleTask}"
+and "{@code singleInstance}" the answer is yes. They mark activities that
+can only be the root activities of a task; they define a task. In contrast,
+"{@code standard}" and "{@code singleTop}" activities can belong to any task.
+</p></li>
+
+<li><p>Whether an existing instance of the activity can handle new
+intents. The answer is yes for all the modes except "{@code standard}".
+Existing "{@code singleTask}" and "{@code singleInstance}" activities
+handle all new intents that come their way; a new instance is never
+created. In the case of "{@code singleTask}", all other activities in
+the task are popped from the stack, so that the root "{@code singleTask}"
+activity is at the top and in position to respond to the intent.
+</p>
+
+<p>
+If a "{@code singleTop}" activity is at the
+top of its stack, that object is expected to handle any new intents.
+However, if it's farther down the stack, a new instance is created for
+the intent and pushed on the stack.
+</p>
+
+<p>
+In contrast, a new instance of a "{@code standard}" activity is always
+created for each new intent.
+</p>
+</li>
+</ul>
+
+<p>
+When an existing activity is asked to handle a new intent, the Intent
+object is passed to the activity in an <code>{@link android.app.Activity#onNewIntent
+onNewIntent()}</code> call. (The intent object that originally started the
+activity can be retrieved by calling
+<code>{@link android.app.Activity#getIntent getIntent()}</code>.)
+</p>
+
+<p>
+Note that when a new instance of an Activity is created to handle a new
+intent, the user can always press the BACK key to return to the previous state
+(to the previous activity). But when an existing instance of an
+Activity handles a new intent, the user cannot press the BACK key to
+return to what that instance was doing before the new intent arrived.
+</p>
+
+<p>
+For more on launch modes, see
+<a href="{@docRoot}guide/topics/manifest/manifest.html">The
+AndroidManifest.xml File</a>
+</p>
+
+
+<h3><a name="clearstack"></a>Clearing the 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,
+it's as the user left it, except that only the initial activity is present.
+The idea is that, after
+a time, users will likely have abandoned what they were doing before and are
+returning to the task to begin something new.
+</p>
+
+<p>
+That's the default. There are some activity attributes that can be used to
+control this behavior and modify it:
+</p>
+
+<dl>
+<dt>The {@code alwaysRetainTaskState} attribute</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.
+Activities are retained in the stack even after a long period.</dd>
+
+<dt>The {@code clearTaskOnLaunch} attribute</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 polar opposite of
+{@code alwaysRetainTaskState}. The user always returns to the task in its
+initial state, even after a momentary absence.</dd>
+
+<dt>The {@code finishOnTaskLaunch} attribute</dt>
+<dd>This attribute is like {@code clearTaskOnLaunch}, but it operates on a
+single activity, not an entire task. And it can 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 relaunches the task, it no longer is present.</dd>
+</dl>
+
+<p>
+There's another way to force activities to be removed from the stack.
+If an Intent object includes the <code>{@link
+android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP FLAG_ACTIVITY_CLEAR_TOP}</code>
+flag, and the target task already has an instance of the type of activity that
+should handle the intent in its stack, all activities above that instance
+are cleared away so that it stands at the top of the stack and can respond
+to the intent.
+</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>
+
+
+<h3><a name="starttask"></a>Starting tasks</h3>
+
+<p>
+An activity is set up 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. (There's an example of this type of filter
+in the earlier <a href="#ifilters">Intent Filters</a> section.)
+A filter of this kind causes an icon and label for the activity to be
+displayed in the application launcher, giving users a way both to
+launch the task and to return to it at 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. For this reason, the two launch modes
+that mark activities as always initiating a task, "{@code singleTask}"
+and "{@code singleInstance}", should be used only when the activity has
+a {@code MAIN} and {@code 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 HOME key. The task is now ordered behind and obscured by the home
+screen. And, because it is not represented in the application launcher,
+the user has no way to return to it.
+</p>
+
+<p>
+A similar difficulty attends the {@code FLAG_ACTIVITY_NEW_TASK} flag.
+If this flag causes an activity to
+begin a new task and the user presses the HOME key to leave it, there
+must be some way for the user to navigate back to it again. 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
+{@code 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.
+</p>
+
+<p>
+For those cases where you don't want the user to be able to return
+to an activity, set the {@code &lt;activity&gt;} element's {@code
+finishOnTaskLaunch} to "{@code true}".
+See <a href="#clearstack">Clearing the stack</a>, earlier.
+</p>
+
+
+<h2><a name="procthread"></a>Processes and Threads</h2>
+
+<p>
+When the first of an application's components needs to be run, Android
+starts a Linux process for it with a single thread of execution. By default,
+all components of the application run in that process and thread.
+</p>
+
+<p>
+However, you can arrange for components to run in other processes as well as
+spawn additional threads:
+</p>
+
+<ul>
+<li>The process where a component runs is controlled by the manifest file.
+The component elements &mdash; {@code &lt;activity&gt;},
+{@code &lt;service&gt;}, {@code &lt;receiver&gt;}, and {@code &lt;provider&gt;}
+&mdash; each have a {@code process} attribute that can specify a process
+where that component should run. These attributes can be set so that each
+component runs in its own process, or so that some components share a process
+while others do not. They can also be set so that components of
+different applications run in the same process &mdash; provided that the
+applications share the same Linux user ID and are signed by the same authorities.
+The {@code &lt;application&gt;} element also has a {@code process} attribute,
+for setting a default value that applies to all components.</li>
+
+<li><p>Threads are created in code using standard Java {@link java.lang.Thread}
+objects. Android provides a number of convenience classes for managing threads
+&mdash; {@link android.os.Looper} for running a message loop within a thread,
+{@link android.os.Handler} for processing messages, and
+{@link android.os.HandlerThread} for setting up a thread with a message loop.</p>
+
+<p>
+Even though you may confine your application to a single process, there may be
+times when you will need to spawn a thread to do some background work. Since the
+user interface must always be quick to respond to user actions, the
+thread that hosts an activity should not also host time-consuming operations like
+network downloads, or anything else that may not be completed quickly.
+</p></li>
+</ul>
+
+<p>
+Android may decide to shut down a process at some point, when memory is
+low and required by other applications that are more immediately serving
+the user. Application components running in the process are consequently
+destroyed. A process is restarted for those components when there's again
+work for them to do.
+</p>
+
+<p>
+When deciding which processes to terminate, Android weighs their relative
+importance to the user. For example, it more readily shuts down a process
+with activities that are no longer visible on screen than a process with
+visible activities.
+The decision whether to terminate a process, therefore, depends on the state
+of the components running in that process. Those states are the subject of
+the next section, <a href="#lcycles">Lifecycles</a>.
+</p>
+
+
+<h2><a name="lcycles"></a>Lifecycles</h2>
+
+<p>
+Application components have a lifecycle &mdash; a beginning when
+Android instantiates them to respond to intents through to an end when
+the instances are destroyed. In between, they may sometimes be active
+or inactive, or, in the case of activities, visible to the user or
+invisible. This section discusses the lifecycles of activities,
+services, and broadcast receivers &mdash; including the states that they
+can be in during their lifetimes, the methods that notify you of transitions
+between states, and the effect of those states on the possibility that
+the process hosting them might be terminated and the instances destroyed.
+</p>
+
+
+<h3><a name="actlife"></a>Activity lifecycle</h3>
+
+<p>An activity has essentially three states:</p>
+
+<ul>
+<li> It is <em>active</em> or <em>running</em> when it is in the foreground of the
+screen (at the top of the activity stack for the current task). This is the
+activity that is the focus for the user's actions.</li>
+
+<li><p>It is <em>paused</em> if it has lost focus but is still visible to the user.
+That is, another activity lies on top of it and that activity either is transparent
+or doesn't cover the full screen, so some of the paused activity can show through.
+A paused activity is completely alive (it maintains all state and member information
+and remains attached to the window manager), but can be killed by the system in
+extreme low memory situations.</p></li>
+
+<li><p>It is <em>stopped</em> if it is completely obscured by another activity.
+It still retains all state and member information. However, it is no longer
+visible to the user so its window is hidden and it will often be killed by the
+system when memory is needed elsewhere.</p></li>
+</ul>
+
+<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 it is displayed again
+to the user, it must be completely restarted and restored to its previous state.
+</p>
+
+
+<h4>Lifecycle methods</h4>
+
+<p>
+As an activity transitions from state to state, it is notified of the change
+by calls to the following protected methods:
+
+<p style="margin-left: 2em">{@code void onCreate(Bundle <i>savedInstanceState</i>)}
+<br/>{@code void onStart()}
+<br/>{@code void onRestart()}
+<br/>{@code void onResume()}
+<br/>{@code void onPause()}
+<br/>{@code void onStop()}
+<br/>{@code void onDestroy()}</p>
+
+<p>
+All of these methods are hooks that you can override to do appropriate work
+when the state changes.
+All activities must implement <code>{@link android.app.Activity#onCreate
+onCreate()}</code> to do initial setup when the activity is first instantiated.
+Many will also implement <code>{@link android.app.Activity#onPause onPause()}</code>
+to commit data changes and otherwise prepare to stop interacting with the user.
+</p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>Calling into the superclass</h2>
+<p>
+An implementation of any activity lifecycle method should always first
+call the superclass version. For example:
+</p>
+
+<pre>protected void onPause() {
+ super.onPause();
+ . . .
+}</pre>
+</div>
+</div>
+
+
+<p>
+Taken together, these seven methods define the entire lifecycle of an
+activity. There are three nested loops that you can monitor by
+implementing them:
+</p>
+
+<ul>
+<li>The <b>entire lifetime</b> of an activity happens between the first call
+to <code>{@link android.app.Activity#onCreate onCreate()}</code> through to a
+single final call to <code>{@link android.app.Activity#onDestroy}</code>.
+An activity does all its initial setup of "global" state in {@code onCreate()},
+and releases all remaining resources in {@code onDestroy()}. For example,
+if it has a thread running in the background to download data from the network,
+it may create that thread in {@code onCreate()} and then stop the thread in
+{@code onDestroy()}.</li>
+
+<li><p>The <b>visible lifetime</b> of an activity happens between a call to
+<code>{@link android.app.Activity#onStart onStart()}</code> until a
+corresponding call to <code>{@link android.app.Activity#onStop onStop()}</code>.
+During this time, the user can see the activity on-screen, though it may not
+be in the foreground and interacting with the user. 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
+{@code onStart()} to monitor for changes that impact your UI, and unregister
+it in {@code onStop()} when the user can no longer see what you are displaying.
+The {@code onStart()} and {@code onStop()} methods can be called multiple times,
+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 a call
+to <code>{@link android.app.Activity#onResume onResume()}</code> until a
+corresponding call to <code>{@link android.app.Activity#onPause onPause()}</code>.
+During this time, the activity is in front of all other activities on screen and
+is interacting with the user. An activity can frequently transition between the
+resumed and paused states &mdash; for example, {@code onPause()} is called when
+the device goes to sleep or when a new activity is started, {@code onResume()}
+is called when an activity result or a new intent is delivered. Therefore, the
+code in these two methods should be fairly lightweight.</p></li>
+</ul>
+
+<p>
+The following diagram illustrates these loops and the paths an activity
+may take between states. The colored ovals are major states the activity
+can be in. The square rectangles represent the callback methods you can implement
+to perform operations when the activity transitions between states.
+<p>
+
+<p><img src="{@docRoot}images/activity_lifecycle.png"
+alt="State diagram for an Android activity lifecycle." border="0" /></p>
+
+<p>
+The following table describes each of these methods in more detail and
+locates it within the activity's overall lifecycle:
+</p>
+
+<table border="2" width="85%" align="center" frame="hsides" rules="rows">
+<colgroup align="left" span="3" />
+<colgroup align="left" />
+<colgroup align="center" />
+<colgroup align="center" />
+
+<thead>
+<tr><th colspan="3">Method</th> <th>Description</th> <th>Killable?</th> <th>Next</th></tr>
+</thead>
+
+<tbody>
+<tr>
+ <td colspan="3" align="left" border="0"><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 &mdash;
+ 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;">&nbsp;&nbsp;&nbsp;&nbsp;</td>
+ <td colspan="2" align="left" border="0"><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" border="0"><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;">&nbsp;&nbsp;&nbsp;&nbsp;</td>
+ <td align="left" border="0"><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" border="0"><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"><font color="#800000"><strong>Yes</strong></font></td>
+ <td align="center">{@code onResume()} <br/>or<br/> {@code onStop()}</td>
+</tr>
+
+<tr>
+ <td colspan="2" align="left" border="0"><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"><font color="#800000"><strong>Yes</strong></font></td>
+ <td align="center">{@code onRestart()} <br/>or<br/> {@code onDestroy()}</td>
+</tr>
+
+<tr>
+ <td colspan="3" align="left" border="0"><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"><font color="#800000"><strong>Yes</strong></font></td>
+ <td align="center"><em>nothing</em></td>
+</tr>
+</tbody>
+</table>
+
+<p>
+Note the <b>Killable</b> column in the table above. It indicates
+whether or not the system can kill the process hosting the activity
+<em>at any time after the method returns, without executing another
+line of the activity's code</em>. Three methods ({@code onPause()},
+{@code onStop()}, and {@code onDestroy()}) are marked "Yes." Because
+{@code onPause()} is the first of the three, it's the only one that's
+guaranteed to be called before the process is killed &mdash
+{@code onStop()} and {@code onDestroy()} may not be. Therefore, you
+should use {@code onPause()} to write any persistent data (such as user
+edits) to storage.
+</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 in a killable state, for example, from the
+time {@code onPause()} returns to the time {@code onResume()} is called.
+It will not again be killable until {@code onPause()} again returns.
+</p>
+
+<p>
+As noted in a later section, <a href="#proclife">Processes and lifecycle</a>,
+an activity that's not technically "killable" by this definition might
+still be killed by the system &mdash; but that would happen only in
+extreme and dire circumstances when there is no other recourse.
+</p>
+
+
+<h4><a name="actstate"></a>Saving activity state</h4>
+
+<p>
+When the system, rather than the user, shuts down an activity to conserve
+memory, the user may expect to return to the activity and find it in its
+previous state.
+</p>
+
+<p>
+To capture that state before the activity is killed, you can implement
+an <code>{@link android.app.Activity#onSaveInstanceState
+onSaveInstanceState()}</code> method for the activity. Android calls this
+method before making the activity vulnerable to being destroyed &mdash
+that is, before {@code onPause()} is called. It
+passes the method a {@link android.os.Bundle} object where you can record
+the dynamic state of the activity as name-value pairs. When the activity is
+again started, the Bundle is passed both to {@code onCreate()} and to a
+method that's called after {@code onStart()}, <code>{@link
+android.app.Activity#onRestoreInstanceState onRestoreInstanceState()}</code>,
+so that either or both of them can recreate the captured state.
+</p>
+
+<p>
+Unlike {@code onPause()} and the other methods discussed earlier,
+{@code onSaveInstanceState()} and {@code onRestoreInstanceState()} are
+not lifecycle methods. They are not always called. For example, Android
+calls {@code onSaveInstanceState()} before the activity becomes
+vulnerable to being destroyed by the system, but does not bother
+calling it when the instance is actually being destroyed by a user action
+(such as pressing the BACK key). In that case, the user won't expect to
+return to the activity, so there's no reason to save its state.
+</p>
+
+<p>
+Because {@code onSaveInstanceState()} is not always called, you
+should use it only to record the transient state of the activity,
+not to store persistent data. Use {@code onPause()} for that purpose
+instead.
+</p>
+
+
+<h3><a name="servlife"></a>Service lifecycle</h3>
+
+<p>
+A service can be used in two ways:
+</p>
+
+<ul>
+<li>It can be started and allowed to run until someone stops it or
+it stops itself. In this mode, it's started by calling
+<code>{@link android.content.Context#startService Context.startService()}</code>
+and stopped by calling
+<code>{@link android.content.Context#stopService Context.stopService()}</code>.
+It can stop itself by calling
+<code>{@link android.app.Service#stopSelf() Service.stopSelf()}</code> or
+<code>{@link android.app.Service#stopSelfResult Service.stopSelfResult()}</code>.
+Only one {@code stopService()} call is needed to stop the service, no matter how
+many times {@code startService()} was called.</li>
+
+<li><p>It can be operated programmatically using an interface that
+it defines and exports. Clients establish a connection to the Service
+object and use that connection to call into the service. The connection is
+established by calling
+<code>{@link android.content.Context#bindService Context.bindService()}</code>,
+and is closed by calling
+<code>{@link android.content.Context#unbindService Context.unbindService()}</code>.
+Multiple clients can bind to the same service.
+If the service has not already been launched, {@code bindService()} can optionally
+launch it.
+</p></li>
+</ul>
+
+<p>
+The two modes are not entirely separate. You can bind to a service that
+was started with {@code startService()}. For example, a background music
+service could be started by calling {@code startService()} with an Intent
+object that identifies the music to play. Only later, possibly when the
+user wants to exercise some control over the player or get information
+about the current song, would an activity
+establish a connection to the service by calling {@code bindService()}.
+In cases like this, {@code stopService()}
+will not actually stop the service until the last binding is closed.
+</p>
+
+<p>
+Like an activity, a service has lifecycle methods that you can implement
+to monitor changes in its state. But they are fewer than the activity
+methods &mdash; only three &mdash; and they are public, not protected:
+</p>
+
+<p style="margin-left: 2em">{@code void onCreate()}
+<br/>{@code void onStart(Intent <i>intent</i>)}
+<br/>{@code void onDestroy()}</p>
+
+<p>
+By implementing these methods, you can monitor two nested loops of the
+service's lifecycle:
+</p>
+
+<ul>
+<li>The <b>entire lifetime</b> of a service happens between the time
+<code>{@link android.app.Service#onCreate onCreate()}</code> is called and
+the time <code>{@link android.app.Service#onDestroy}</code> returns.
+Like an activity, a service does its initial setup in {@code onCreate()},
+and releases all remaining resources in {@code onDestroy()}. For example,
+a music playback service could create the thread where the music will be played
+in {@code onCreate()}, and then stop the thread in {@code onDestroy()}.</li>
+
+<li><p>The <b>active lifetime</b> of a service begins with a call to
+<code>{@link android.app.Service#onStart onStart()}</code>. This method
+is handed the Intent object that was passed to {@code startService()}.
+The music service would open the Intent to discover which music to
+play, and begin the playback.</p>
+
+<p>
+There's no equivalent callback for when the service stops &mdash; no
+{@code onStop()} method.
+</p></li>
+</ul>
+
+<p>
+The {@code onCreate()} and {@code onDestroy()} methods are called for all
+services, whether they're started by
+<code>{@link android.content.Context#startService Context.startService()}</code>
+or
+<code>{@link android.content.Context#bindService Context.bindService()}</code>.
+However, {@code onStart()} is called only for services started by {@code
+startService()}.
+</p>
+
+<p>
+If a service permits others to
+bind to it, there are additional callback methods for it to implement:
+</p>
+
+<p style="margin-left: 2em">{@code IBinder onBind(Intent <i>intent</i>)}
+<br/>{@code boolean onUnbind(Intent <i>intent</i>)}
+<br/>{@code void onRebind(Intent <i>intent</i>)}</p>
+
+<p>
+The <code>{@link android.app.Service#onBind onBind()}</code> callback is passed
+the Intent object that was passed to {@code bindService} and
+<code>{@link android.app.Service#onUnbind onUnbind()}</code> is handed
+the intent that was passed to {@code unbindService()}.
+If the service permits the binding, {@code onBind()}
+returns the communications channel that clients use to interact with the service.
+The {@code onUnbind()} method can ask for
+<code>{@link android.app.Service#onRebind onRebind()}</code>
+to be called if a new client connects to the service.
+</p>
+
+<p>
+The following diagram illustrates the callback methods for a service.
+Although, it separates services that are created via {@code startService}
+from those created by {@code bindService()}, keep in mind that any service,
+no matter how it's started, can potentially allow clients to bind to it,
+so any service may receive {@code onBind()} and {@code onUnbind()} calls.
+</p>
+
+<p><img src="{@docRoot}images/service_lifecycle.png"
+alt="State diagram for Service callbacks." border="0" /></p>
+
+
+<h3><a name="broadlife"></a>Broadcast receiver lifecycle</h3>
+
+<p>
+A broadcast receiver has single callback method:
+</p>
+
+<p style="margin-left: 2em">{@code void onReceive(Context <i>curContext</i>, Intent <i>broadcastMsg</i>)}</p>
+
+<p>
+When a broadcast message arrives for the receiver, Android calls its
+<code>{@link android.content.BroadcastReceiver#onReceive onReceive()}</code>
+method and passes it the Intent object containing the message. The broadcast
+receiver is considered to be active only while it is executing this method.
+When {@code onReceive()} returns, it is inactive.
+</p>
+
+<p>
+A process with an active broadcast receiver is protected from being killed.
+But a process with only inactive components can be killed by the system at
+any time, when the memory it consumes is needed by other processes.
+</p>
+
+<p>
+This presents a problem when the response to a broadcast message is time
+consuming and, therefore, something that should be done in a separate thread,
+away from the main thread where other components of the user interface run.
+If {@code onReceive()} spawns the thread and then returns, the entire process,
+including the new thread, is judged to be inactive (unless other application
+components are active in the process), putting it in jeopardy of being killed.
+The solution to this problem is for {@code onReceive()} to start a service
+and let the service do the job, so the
+system knows that there is still active work being done in the process.
+</p>
+
+<p>
+The next section has more on the vulnerability of processes to being killed.
+</p>
+
+
+<h3><a name="proclife"></a>Processes and lifecycles</h3>
+
+<p>The Android system tries to maintain an application process for as
+long as possible, but eventually it will need to remove old processes when
+memory runs low. To determine which processes to keep and which to kill,
+Android places each process into an "importance hierarchy" based on the
+components running in it and the state of those components. There are
+five levels in the hierarchy. The following list presents them in order
+of importance:
+</p>
+
+<ol>
+
+<li>A <b>foreground process</b> is one 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 hold:
+
+<ul>
+<li>It is running an activity that the user is interacting with
+(the Activity object's <code>{@link android.app.Activity#onResume
+onResume()}</code> method has been called).</p></li>
+
+<li><p>It hosts a service that's bound
+to the activity that the user is interacting with.</p></li>
+
+<li><p>It has a {@link android.app.Service} object that's executing
+one of its lifecycle callbacks (<code>{@link android.app.Service#onCreate
+onCreate()}</code>, <code>{@link android.app.Service#onStart onStart()}</code>,
+or <code>{@link android.app.Service#onDestroy onDestroy()}</code>).</p></li>
+
+<li><p>It has a {@link android.content.BroadcastReceiver} object that's
+executing its <code>{@link android.content.BroadcastReceiver#onReceive
+onReceive()}</code> method.</p></li>
+</ul>
+
+<p>
+Only a few foreground processes will exist at any given time. They
+are killed only as a last resort &mdash; 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><p>A <b>visible process</b> is one 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
+holds:</p>
+
+<ul>
+<li>It hosts an activity that is not in the foreground, but is still visible
+to the user (its <code>{@link android.app.Activity#onPause onPause()}</code>
+method has been called). This may occur, for example, if the foreground
+activity is a dialog that allows the previous activity to be seen behind it.</li>
+
+<li><p>It hosts a service that's bound to a visible activity.</p></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><p>A <b>service process</b> is one that is running a service that has
+been started with the
+<code>{@link android.content.Context#startService startService()}</code>
+method. 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 an mp3 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.
+(Note that a service can be ranked higher than this by virtue of being
+bound to a visible or foreground activity).
+</p></li>
+
+<li><p>A <b>background process</b> is one holding an activity
+that's not currently visible to the user (the Activity object's
+<code>{@link android.app.Activity#onStop onStop()}</code> method has been called).
+These processes have no direct impact on the user experience, and can be killed
+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 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 captures its current
+state, killing its process will not have a deleterious effect on the user experience.
+</p></li>
+
+<li><p>An <b>empty process</b> is one that doesn't hold any active application
+components. The only reason to keep such a process around is as a cache 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 will be
+ranked as a visible process, not a service process.
+</p>
+
+<p>
+In addition, a process's ranking may 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 will always be
+considered at least as important as process B.
+</p>
+
+<p>
+Because a process running a service is ranked higher than one with background
+activities, an activity that initiates a long-running operation might do
+well to start a service for that operation, rather than simply spawn a thread
+&mdash; particularly if the operation will likely outlast the activity.
+Examples of this are playing music in the background
+and uploading a picture taken by the camera to a web site. Using a service
+guarantees that the operation will have at least "service process" priority,
+regardless of what happens to the activity. As noted in the
+<a href="#broadlife">Broadcast receiver lifecycle</a> section earlier, this
+is the same reason that broadcast receivers should employ services rather
+than simply put time-consuming operations in a thread.
+</p>
diff --git a/docs/html/guide/topics/graphics/2d-graphics.jd b/docs/html/guide/topics/graphics/2d-graphics.jd
new file mode 100644
index 0000000..822c66f
--- /dev/null
+++ b/docs/html/guide/topics/graphics/2d-graphics.jd
@@ -0,0 +1,459 @@
+page.title=2D Graphics
+parent.title=2D and 3D Graphics
+parent.link=index.html
+@jd:body
+
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#drawables">Drawables</a>
+ <ol>
+ <li><a href="#drawable-images">Creating from resource images</a></li>
+ <li><a href="#drawable-xml">Creating from resource XML</a></li>
+ </ol>
+ </li>
+ <li><a href="#shape-drawable">ShapeDrawable</a></li>
+ <!-- <li><a href="#state-list">StateListDrawable</a></li> -->
+ <li><a href="#nine-patch">NinePatchDrawable</a></li>
+ <li><a href="#tween-animation">Tween Animation</a></li>
+ <li><a href="#frame-animation">Frame Animation</a></li>
+ </ol>
+ </div>
+</div>
+
+<p>Android offers a custom 2D graphics library for drawing and animating shapes and images.
+The {@link android.graphics.drawable} and {@link android.view.animation}
+packages are where you'll find the common classes used for drawing and animating in two-dimensions.
+</p>
+
+<p>This document offers an introduction to drawing graphics in your Android application.
+We'll discuss the basics of using Drawable objects to draw
+graphics, how to use a couple subclasses of the Drawable class, and how to
+create animations that either tween (move, stretch, rotate) a single graphic
+or animate a series of graphics (like a roll of film).</p>
+
+
+<h2 id="drawables">Drawables</h2>
+
+<p>A {@link android.graphics.drawable.Drawable} is a general abstraction for "something that can be drawn."
+You'll discover that the Drawable class extends to define a variety of specific kinds of drawable graphics,
+including {@link android.graphics.drawable.BitmapDrawable}, {@link android.graphics.drawable.ShapeDrawable},
+{@link android.graphics.drawable.PictureDrawable}, {@link android.graphics.drawable.LayerDrawable}, and several more.
+Of course, you can also extend these to define your own custom Drawable objects that behave in unique ways.</p>
+
+<p>There are three ways to define and instantiate a Drawable: using an image saved in your project resouces;
+using an XML file that defines the Drawable properties; or using the normal class constructors. Below, we'll discuss
+each the first two techniques (using constructors is nothing new for an experienced developer).</p>
+
+
+<h3 id="drawables-from-images">Creating from resource images</h3>
+
+<p>A simple way to add graphics to your application is by referencing an image file from your project resources.
+Supported file types are PNG (preferred), JPG (acceptable) and GIF (discouraged). This technique would
+obviously be preferred for application icons, logos, or other graphics such as those used in a game.</p>
+
+<p>To use an image resource, just add your file to the <code>res/drawable/</code> directory of your project.
+From there, you can reference it from your code or your XML layout.
+Either way, it is referred using a resource ID, which is the file name without the file type
+extension (E.g., <code>my_image.png</code> is referenced as <var>my_image</var>).</p>
+
+<h4>Example code</h4>
+<p>The following code snippet demonstrates how to build an {@link android.widget.ImageView} that uses an image
+from drawable resources and add it to the layout.</p>
+<pre>
+LinearLayout mLinearLayout;
+
+protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // Create a LinearLayout in which to add the ImageView
+ mLinearLayout = new LinearLayout(this);
+
+ // Instantiate an ImageView and define its properties
+ ImageView i = new ImageView(this);
+ i.setImageResource(R.drawable.my_image);
+ i.setAdjustViewBounds(true); // set the ImageView bounds to match the Drawable's dimensions
+ i.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
+
+ // Add the ImageView to the layout and set the layout as the content view
+ mLinearLayout.addView(i);
+ setContentView(mLinearLayout);
+}
+</pre>
+<p>In other cases, you may want to handle your image resource as a
+{@link android.graphics.drawable.Drawable} object.
+To do so, create a Drawable from the resource like so:
+<pre>Drawable myImage = Resources.getDrawable(R.drawable.my_image);</pre>
+
+<h4>Example XML</h4>
+<p>The XML snippet below shows how to add a resource Drawable to an
+{@link android.widget.ImageView} in the XML layout (with some red tint just for fun).
+<pre>
+&lt;ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:tint="#55ff0000"
+ android:src="@drawable/my_image"/>
+</pre>
+<p>For more information on using project resources, read about
+ <a href="{@docRoot}guide/topics/resources/index.html">Resources and Assets</a>.</p>
+
+
+<h3 id="drawables-from-xml">Creating from resource XML</h3>
+
+<p>By now, you should be familiar with Android's principles of
+<a href="{@docRoot}guide/topics/views/index.html">Views and Layout</a>. Hence, you understand the power
+and flexibility inherent in defining objects in XML. This philosophy caries over from Views to Drawables.
+If there is a Drawable object that you'd like to create, which is not initially dependent on variables defined by
+your applicaton code or user interaction, then defining the Drawable in XML is a good option.
+Even if you expect your Drawable to change its properties during the user's experience with your application,
+you should consider defining the object in XML, as you can always modify properties once it is instantiated.</p>
+
+<p>Once you've defined your Drawable in XML, save the file in the <code>res/drawable/</code> directory of
+your project. Then, retrieve and instantiate the object by calling
+{@link android.content.res.Resources#getDrawable(int) Resources.getDrawable()}, passing it the resource ID
+of your XML file. (See the <a href="#drawable-xml-example">example below</a>.)</p>
+
+<p>Any Drawable subclass that supports the <code>inflate()</code> method can be defined in
+XML and instantiated by your application.
+Each Drawable that supports XML inflation utilizes specific XML attributes that help define the object
+properties (see the class reference to see what these are). See the class documentation for each
+Drawable subclass for information on how to define it in XML.
+
+<h4 id="drawable-xml-example">Example</h4>
+<p>Here's some XML that defines a TransitionDrawable:</p>
+<pre>
+&lt;transition xmlns:android="http://schemas.android.com/apk/res/android">
+ &lt;item android:drawable="&#64;drawable/image_expand">
+ &lt;item android:drawable="&#64;drawable/image_collapse">
+&lt;/transition>
+</pre>
+
+<p>With this XML saved in the file <code>res/drawable/expand_collapse.xml</code>,
+the following code will instantiate the TransitionDrawable and set it as the content of an ImageView:</p>
+<pre>
+Resources res = mContext.getResources();
+TransitionDrawable transition = (TransitionDrawable) res.getDrawable(R.drawable.expand_collapse);
+ImageView image = (ImageView) findViewById(R.id.toggle_image);
+image.setImageDrawable(transition);
+</pre>
+<p>Then this transition can be run forward (for 1 second) with:</p>
+<pre>transition.startTransition(1000);</pre>
+
+<p>Refer to the Drawable classes listed above for more information on the XML attributes supported by each.</p>
+
+
+
+<h2 id="shape-drawable">ShapeDrawable</h2>
+
+<p>When you want to dynamically draw some two-dimensional graphics, a {@link android.graphics.drawable.ShapeDrawable}
+object will probably suit your needs. With a ShapeDrawable, you can programmatically draw
+primitive shapes and style them in any way imaginable.</p>
+
+<p>A ShapeDrawable is an extension of {@link android.graphics.drawable.Drawable}, so you can use one where ever
+a Drawable is expected &mdash; perhaps for the background of a View, set with
+{@link android.view.View#setBackgroundDrawable(android.graphics.drawable.Drawable) setBackgroundDrawable()}.
+Of course, you can also draw your shape as its own custom {@link android.view.View},
+to be added to your layout however you please.
+Because the ShapeDrawable has its own <code>draw()</code> method, you can create a subclass of View that
+draws the ShapeDrawable during the <code>View.onDraw()</code> method.
+Here's a basic extension of the View class that does just this, to draw a ShapeDrawable as a View:</p>
+<pre>
+public class CustomDrawableView extends View {
+ private ShapeDrawable mDrawable;
+
+ public CustomDrawableView(Context context) {
+ super(context);
+
+ int x = 10;
+ int y = 10;
+ int width = 300;
+ int height = 50;
+
+ mDrawable = new ShapeDrawable(new OvalShape());
+ mDrawable.getPaint().setColor(0xff74AC23);
+ mDrawable.setBounds(x, y, x + width, y + height);
+ }
+
+ protected void onDraw(Canvas canvas) {
+ mDrawable.draw(canvas);
+ }
+}
+</pre>
+
+<p>In the constructor, a ShapeDrawable is defines as an {@link android.graphics.drawable.shapes.OvalShape}.
+It's then given a color and the bounds of the shape are set. If you do not set the bounds, then the
+shape will not be drawn, whereas if you don't set the color, it will default to black.</p>
+<p>With the custom View defined, it can be drawn any way you like. With the sample above, we can
+draw the shape progammatically in an Activity:</p>
+<pre>
+CustomDrawableView mCustomDrawableView;
+
+protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mCustomDrawableView = new CustomDrawableView(this);
+
+ setContentView(mCustomDrawableView);
+}
+</pre>
+
+<p>If you'd like to draw this custom drawable from the XML layout instead of from the Activity,
+then the CustomDrawable class must override the {@link android.view.View#View(android.content.Context, android.util.AttributeSet) View(Context, AttributeSet)} constructor, which is called when
+instantiating a View via inflation from XML. Then add a CustomDrawable element to the XML,
+like so:</p>
+<pre>
+&lt;com.example.shapedrawable.CustomDrawableView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ />
+</pre>
+
+<p>The ShapeDrawable class (like many other Drawable types in the {@link android.graphics.drawable} package)
+allows you to define various properties of the drawable with public methods.
+Some properties you might want to adjust include
+alpha transparency, color filter, dither, opacity and color.</p>
+
+<!-- TODO
+<h2 id="state-list">StateListDrawable</h2>
+
+<p>A StateListDrawable is an extension of the DrawableContainer class, making it little different.
+The primary distinction is that the
+StateListDrawable manages a collection of images for the Drawable, instead of just one.
+This means that it can switch the image when you want, without switching objects. However, the
+intention of the StateListDrawable is to automatically change the image used based on the state
+of the object it's attached to.
+-->
+
+<h2 id="nine-patch">NinePatchDrawable</h2>
+
+<p>A {@link android.graphics.drawable.NinePatchDrawable} graphic is a stretchable bitmap image, which Android
+will automatically resize to accomodate the contents of the View in which you have placed it as the background.
+An example use of a NinePatch is the backgrounds used by standard Android buttons &mdash;
+buttons must stretch to accommodate strings of various lengths. A NinePatch drawable is a standard PNG
+image that includes an extra 1-pixel-wide border. It must be saved with the extension <code>.9.png</code>,
+and saved into the <code>res/drawable/</code> directory of your project.
+</p>
+<p>
+ The border is used to define the stretchable and static areas of
+ the image. You indicate a stretchable section by drawing one (or more) 1-pixel-wide
+ black line(s) in the left and top part of the border. (You can have as
+ many stretchable sections as you want.) The relative size of the stretchable
+ sections stays the same, so the largest sections always remain the largest.
+</p>
+<p>
+ You can also define an optional drawable section of the image (effectively,
+ the padding lines) by drawing a line on the right and bottom lines.
+ If a View object sets the NinePatch as its background and then specifies the
+ View's text, it will stretch itself so that all the text fits inside only
+ the area designated by the right and bottom lines (if included). If the
+ padding lines are not included, Android uses the left and top lines to
+ define this drawable area.
+</p>
+<p>To clarify the difference between the different lines, the left and top lines define
+which pixels of the image are allowed to be replicated in order to strech the image.
+The bottom and right lines define the relative area within the image that the contents
+of the View are allowed to lie within.</p>
+<p>
+ Here is a sample NinePatch file used to define a button:
+</p>
+ <img src="{@docRoot}images/ninepatch_raw.png" alt="" />
+
+<p>This NinePatch defines one stretchable area with the left and top lines
+and the drawable area with the bottom and right lines. In the top image, the dotted grey
+lines identify the regions of the image that will be replicated in order to strech the image. The pink
+rectangle in the bottom image identifies the region in which the contents of the View are allowed.
+If the contents don't fit in this region, then the image will be stretched so that they do.
+</p>
+
+<p>The <a href="{@docRoot}guide/developing/tools/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.
+</p>
+
+<h3>Example XML</h3>
+
+<p>Here's some sample layout XML that demonstrates how to add a NinePatch image to a
+couple of buttons. (The NinePatch image is saved as <code>res/drawable/my_button_background.9.png</code>
+<pre>
+&lt;Button id="@+id/tiny"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:layout_centerInParent="true"
+ android:text="Tiny"
+ android:textSize="8sp"
+ android:background="@drawable/my_button_background"/&gt;
+
+&lt;Button id="@+id/big"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_centerInParent="true"
+ android:text="Biiiiiiig text!"
+ android:textSize="30sp"
+ android:background="@drawable/my_button_background"/&gt;
+</pre>
+<p>Note that the width and height are set to "wrap_content" to make the button fit neatly around the text.
+</p>
+
+<p>Below are the two buttons rendered from the XML and NinePatch image shown above.
+Notice how the width and height of the button varies with the text, and the background image
+stretches to accommodate it.
+</p>
+
+<img src="{@docRoot}images/ninepatch_examples.png" alt=""/>
+
+
+<h2 id="tween-animation">Tween Animation</h2>
+
+<p>A tweened animation can perform a series of simple transformations (position, size, rotation, and transparency) on
+the contents of a View object. So, if you have a TextView object, you can move, rotate, grow, or shrink the text.
+If it has a background image, the background image will be transformed along with the text.</p>
+
+<p>The animation is achieved with a sequence of animation instructions, defined in either XML or code.
+Like defining a layout, an XML file is recommended because it's more readable, reusable, and swappable
+than hard-coding it. In the example below, we use XML. (To define an animation in code, refer to the
+{@link android.view.animation.AnimationSet} class and other {@link android.view.animation.Animation} subclasses.)</p>
+
+<p>The animation XML file belongs in the <code>res/anim/</code> directory of your Android project.
+The file must have a single root element: this will be either a single <code>&lt;alpha&gt;</code>,
+<code>&lt;scale&gt;</code>, <code>&lt;translate&gt;</code>, <code>&lt;rotate&gt;</code>, interpolator element,
+or <code>&lt;set&gt;</code> element that holds groups of these elements (which may include another
+<code>&lt;set&gt;</code>). By default, all animation instructions are applied simultaneously.
+To make them occur sequentially, you must specify the <code>startOffset</code> attribute, as shown in the example below.
+</p>
+
+<p>The following XML from one of the ApiDemos is used to stretch,
+then simultaneously spin and rotate a View object.
+</p>
+<pre>
+&lt;set android:shareInterpolator="false"&gt;
+ &lt;scale
+ android:interpolator="&#64;android:anim/accelerate_decelerate_interpolator"
+ android:fromXScale="1.0"
+ android:toXScale="1.4"
+ android:fromYScale="1.0"
+ android:toYScale="0.6"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:fillAfter="false"
+ android:duration="700" /&gt;
+ &lt;set android:interpolator="&#64;android:anim/decelerate_interpolator"&gt;
+ &lt;scale
+ android:fromXScale="1.4"
+ android:toXScale="0.0"
+ android:fromYScale="0.6"
+ android:toYScale="0.0"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:startOffset="700"
+ android:duration="400"
+ android:fillBefore="false" /&gt;
+ &lt;rotate
+ android:fromDegrees="0"
+ android:toDegrees="-45"
+ android:toYScale="0.0"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:startOffset="700"
+ android:duration="400" /&gt;
+ &lt;/set&gt;
+&lt;/set&gt;
+</pre>
+<p>Screen coordinates (not used in this example) are (0,0) at the upper left hand corner,
+and increase as you go down and to the right.</p>
+
+<p>Some values, such as pivotX, can be specified relative to the object itself or relative to the parent.
+Be sure to use the proper format for what you want ("50" for 50% relative to the parent, or "50%" for 50%
+relative to itself).</p>
+
+<p>You can determine how a transformation is applied over time by assigning an
+{@link android.view.animation.Interpolator}. Android includes
+several Interpolator subclasses that specify various speed curves: for instance,
+{@link android.view.animation.AccelerateInterpolator} tells
+a transformation to start slow and speed up. Each one has an attribute value that can be applied in the XML.</p>
+
+<p>With this XML saved as <code>hyperspace_jump.xml</code> in the <code>res/anim/</code> directory of the
+project, the following Java code will reference it and apply it to an {@link android.widget.ImageView} object
+from the layout.
+</p>
+<pre>
+ImageView spaceshipImage = (ImageView) findViewById(R.id.spaceshipImage);
+Animation hyperspaceJumpAnimation = AnimationUtils.loadAnimation(this, R.anim.hyperspace_jump);
+spaceshipImage.startAnimation(hyperspaceJumpAnimation);
+</pre>
+
+<p>As an alternative to <code>startAnimation()</code>, you can define a starting time for the animation with
+<code>{@link android.view.animation.Animation#setStartTime(long) Animation.setStartTime()}</code>,
+then assign the animation to the View with
+<code>{@link android.view.View#setAnimation(android.view.animation.Animation) View.setAnimation()}</code>.</p>
+
+<p>For more information on the XML syntax, available tags and attributes, see the discussion on animation
+in the <a href="{@docRoot}guide/topics/resources/available-resources.html#animation">Available Resources</a>.</p>
+
+<p class="note"><strong>Note:</strong> Animations are drawn in the area designated for the View at the start of
+the animation; this area does not change to accommodate size or movement, so if your animation moves or expands
+outside the original boundaries of your object, it will be clipped to the size of the original View, even if
+the object's LayoutParams are set to WRAP_CONTENT (the object will not resize to accommodate moving or
+expanding/shrinking animations).</p>
+
+
+<h2 id="frame-animation">Frame Animation</h2>
+
+<p>This is a traditional animation in the sense that it is created with a sequence of different
+images, played in order, like a roll of film.</p>
+
+<p>While you can define the frames of an animation in your code, using the
+{@link android.graphics.drawable.AnimationDrawable} class API, it's more simply accomplished with a single XML
+file that lists the frames that compose the animation. Like the tween animation above, the XML file for this kind
+of animation belongs in the <code>res/anim/</code> directory of your Android project. In this case,
+the instructions are the order and duration for each frame of the animation.</p>
+
+<p>The XML file consists of an <code>&lt;animation-list></code> element as the root node and a series
+of child <code>&lt;item></code> nodes that each define a frame: a drawable resource for the frame and the frame duration.
+Here's an example XML file for a frame-by-frame animation:</p>
+<pre>
+&lt;animation-list xmlns:android="http://schemas.android.com/apk/res/android"
+ android:oneshot="true">
+ &lt;item android:drawable="&#64;drawable/rocket_thrust1" android:duration="200" />
+ &lt;item android:drawable="&#64;drawable/rocket_thrust2" android:duration="200" />
+ &lt;item android:drawable="&#64;drawable/rocket_thrust3" android:duration="200" />
+&lt;/animation-list>
+</pre>
+
+<p>This animation runs for just three frames. By setting the <code>android:oneshot</code> attribute of the
+list to <var>true</var>, it will cycle just once then stop and hold on the last frame. If it is set <var>false</var> then
+the animation will loop. With this XML saved as <code>rocket_thrust.xml</p> in the <code>res/anim/</code> directory
+of the project, it can be added as the background image to a View and then called to play. Here's an example Activity,
+in which the animation is added to an {@link android.widget.ImageView} and then animated when the screen is touched:</p>
+<pre>
+AnimationDrawable rocketAnimation;
+
+public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ ImageView rocketImage = (ImageView) findViewById(R.id.rocket_image);
+ rocketImage.setBackgroundResource(R.anim.rocket_thrust);
+ rocketAnimation = (AnimationDrawable) rocketImage.getBackground();
+}
+
+public boolean onTouchEvent(MotionEvent event) {
+ if (event.getAction() == MotionEvent.ACTION_DOWN) {
+ rocketAnimation.start();
+ return true;
+ }
+ return super.onTouchEvent(event);
+}
+</pre>
+<p>It's important to note that the <code>start()</code> method called on the AnimationDrawable cannot be
+called during the <code>onCreate()</code> method of your Activity, because the AnimationDrawable is not yet fully attached
+to the window. If you want to play the animation immediately, without
+requiring interaction, then you might want to call it from the
+<code>{@link android.app.Activity#onWindowFocusChanged(boolean) onWindowFocusChanged()}</code> method in
+your Activity, which will get called when Android brings your window into focus.</p>
+
+
diff --git a/docs/html/guide/topics/graphics/index.jd b/docs/html/guide/topics/graphics/index.jd
new file mode 100644
index 0000000..388acc9
--- /dev/null
+++ b/docs/html/guide/topics/graphics/index.jd
@@ -0,0 +1,21 @@
+page.title=2D and 3D Graphics
+@jd:body
+
+
+<p>Android graphics are powered by a custom 2D graphics library and OpenGL ES 1.0
+for 3D graphics.</p>
+
+<h2>2D Graphics</h2>
+<p>Android offers a custom 2D graphics library for drawing shapes and images.</p>
+<p>The {@link android.graphics} and {@link android.graphics.drawable}
+packages are where you'll find the classes used for drawing in two-dimensions.
+For common drawing tasks, though, the {@link android.graphics.drawable} package
+is where you'll find what you need.</p>
+<p>For an introduction to drawing shapes and images, read the
+<a href="2d-graphics.html">2D Graphics</a> document.</p>
+
+
+<h2>3D with OpenGL</h2>
+<p>High performance 3D graphic utilities are provided on Android with the OpenGL ES API.
+You'll find the OpenGL APIs in the {@link android.opengl} package.
+Read more about <a href="opengl.html">3D with OpenGL</a>.</p> \ No newline at end of file
diff --git a/docs/html/guide/topics/graphics/opengl.jd b/docs/html/guide/topics/graphics/opengl.jd
new file mode 100644
index 0000000..eb2932d
--- /dev/null
+++ b/docs/html/guide/topics/graphics/opengl.jd
@@ -0,0 +1,56 @@
+page.title=3D with OpenGL
+parent.title=2D and 3D Graphics
+parent.link=index.html
+@jd:body
+
+
+<p>Android includes support for high performance 3D graphics
+via the OpenGL API &mdash; specifically, the OpenGL ES API.</p>
+
+<p>OpenGL ES is a flavor of the OpenGL specification intended for embedded
+devices. Versions of <a href="http://www.khronos.org/opengles/">OpenGL ES</a> 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}guide/samples/ApiDemos/src/com/example/android/apis/graphics/GLSurfaceView.html">com.android.samples.graphics.GLSurfaceView.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}guide/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
+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/intents/index.html b/docs/html/guide/topics/intents/index.html
new file mode 100644
index 0000000..b831246
--- /dev/null
+++ b/docs/html/guide/topics/intents/index.html
@@ -0,0 +1,9 @@
+<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/intents/intents-filters.jd b/docs/html/guide/topics/intents/intents-filters.jd
index 39ca589..d49d27e 100644
--- a/docs/html/guide/topics/intents/intents-filters.jd
+++ b/docs/html/guide/topics/intents/intents-filters.jd
@@ -1,6 +1,30 @@
page.title=Intents and Intent Filters
@jd:body
+<div id="qv-wrapper">
+<div id="qv">
+<h2>Key classes</h2>
+<ol>
+<li>{@link android.content.Intent}</li>
+<li>{@link android.content.IntentFilter}</li>
+<li>{@link android.app.Activity}</li>
+<li>{@link android.app.Service}</li>
+<li>{@link android.content.BroadcastReceiver}</li>
+<li>{@link android.content.pm.PackageManager}</li>
+</ol>
+
+<h2>In this document</h2>
+<ol>
+<li><a href="#iobjs">Intent Objects</a></li>
+<li><a href="#ires">Intent Resolution</a>, including:</li>
+<li style="margin-left: 2em"><a href="#ifs">Intent filters</a></li>
+<li style="margin-left: 2em"><a href="#ccases">Common cases</a></li>
+<li style="margin-left: 2em"><a href="#imatch">Using intent matching</a></li>
+</ol>
+</div>
+</div>
+
+
<p>
Three of the core components of an application &mdash; activities, services, and
broadcast receivers &mdash; are activated through messages, called <i>intents</i>.
@@ -10,29 +34,28 @@ object, is a passive data structure holding an abstract description of an operat
to be performed &mdash; or, in the case of broadcasts, a description of something
that has happened and is being announced. There are separate mechanisms for
delivering intents to each type of component:
+</p>
<ul>
-
-<p><li>An Intent object is passed to <code>{@link android.content.Context#startActivity
+<li>An Intent object is passed to <code>{@link android.content.Context#startActivity
Context.startActivity()}</code> or <code>{@link android.app.Activity#startActivityForResult
Activity.startActivityForResult()}</code> to launch an activity or get an existing
-activity to do something new.
+activity to do something new.</li>
-<p><li>An Intent object is passed to <code>{@link android.content.Context#startService
+<li><p>An Intent object is passed to <code>{@link android.content.Context#startService
Context.startService()}</code> to initiate a service or deliver new instructions to an
ongoing service. Similarly, an intent can be passed to <code>{@link
android.content.Context#bindService Context.bindService()}</code> to establish a
-connection between the calling component and a target service. It initiates the
-service if it's not already running.
+connection between the calling component and a target service. It can optionally
+initiate the service if it's not already running.</p></li>
-<p><li>Intent objects passed to any of the broadcast methods (such as <code>{@link
+<li><p>Intent objects passed to any of the broadcast methods (such as <code>{@link
android.content.Context#sendBroadcast(Intent) Context.sendBroadcast()}</code>,
<code>{@link android.content.Context#sendOrderedBroadcast(Intent, String)
Context.sendOrderedBroadcast()}</code>, or <code>{@link
android.content.Context#sendStickyBroadcast Context.sendStickyBroadcast()}</code>)
are delivered to all interested broadcast receivers. Many kinds of broadcasts
-originate in system code.
-
+originate in system code.</p></li>
</ul>
<p>
@@ -42,71 +65,63 @@ There is no overlap within these messaging systems: Broadcast intents are deliv
only to broadcast receivers, never to activities or services. An intent passed to
{@code startActivity()} is delivered only to an activity, never to a service or
broadcast receiver, and so on.
+</p>
<p>
-Intents can be divided into two groups:
-
-<ul>
-
-<p><li><i>Explicit intents</i> designate the target component by its class name.
-They're typically used for application-internal messages &mdash; such as
-an activity starting a subordinate service or launching a sister activity
-&mdash; since component names would generally not be known to developers
-of other applications.
-
-<p><li><i>Implicit intents</i> do not name the target. Instead, the
-Android system determines the best component (or components) to respond
-to the message. It compares the contents of the Intent object with
-<i>intent filters</i>, structures associated with components that can
-potentially receive intents. Filters advertise the capabilities of a
-component and delimit the intents it can handle.
-
-
-</ul>
-
-<p>
-This document describes the rules Android uses to map intents to components &mdash;
-how it determines which component should receive an intent message.
-It begins with a description of Intent objects, and then describes intent filters
-and how intents are tested against the filters.
+This document begins with a description of Intent objects. It then describes the
+rules Android uses to map intents to components &mdash; how it resolves which
+component should receive an intent message. For intents that don't explicitly
+name a target component, this process involves testing the Intent object against
+<i>intent filters</i> associated with potential targets.
+</p>
-<h2>Intent Objects</h2>
+<h2><a name="iobjs"></a>Intent Objects</h2>
<p>
-An {@link android.content.Intent} object is a bundle of information. It contains
-information of interest to the component that receives the intent (such as the action
-to be taken and the data to act on) plus information
-of interest to the Android system (such as the category of component that should handle
-the intent and instructions on how to launch a target activity). Principally, it can contain
-the following:
+An {@link android.content.Intent} object is a bundle of information. It
+contains information of interest to the component that receives the intent
+(such as the action to be taken and the data to act on) plus information
+of interest to the Android system (such as the category of component that
+should handle the intent and instructions on how to launch a target activity).
+Principally, it can contain the following:
+</p>
<dl>
-<p><dt><b>Component class name</b></dt>
-<dd>The fully qualified class name of the component that should handle the intent
-&mdash; for example "{@code com.example.project.FreneticActivity}".
-This field is optional (and it would not normally be set for broadcast intents, since
-broadcasts are intended for more than a single receiver). However, if a class name
-is specified, nothing else in the Intent
-object matters for determining which component should get the intent; it will be
-delivered to the named component. (Of course, the other contents of the intent will
-matter to the component that receives it.)
-
-<p>
-The component class is set by <code>{@link android.content.Intent#setComponent
+<dt><b>Component name</b><a name="cname"></a></dt>
+<dd>The name of the component that should handle the intent. This field is
+a {@link android.content.ComponentName} object &mdash; a combination of the
+fully qualified class name of the target component (for example "{@code
+com.example.project.app.FreneticActivity}") and the package name set
+in the manifest file of the application where the component resides (for
+example, "{@code com.example.project}"). The package part of the component
+name and the package name set in the manifest do not necessarily have to match.
+
+<p>
+The component name is optional. If it is set, the Intent object is
+delivered to an instance of the designated class. If it is not set,
+Android uses other information in the Intent object to locate a suitable
+target &mdash; see <a href="#ires">Intent Resolution</a>, later in this
+document.
+</p>
+
+<p>
+The component name is set by <code>{@link android.content.Intent#setComponent
setComponent()}</code>, <code>{@link android.content.Intent#setClass
setClass()}</code>, or <code>{@link android.content.Intent#setClassName(String, String)
setClassName()}</code> and read by <code>{@link android.content.Intent#getComponent
getComponent()}</code>.
+</p>
+</dd>
<p><dt><b>Action</b></dt>
<dd>A string naming the action to be performed &mdash; or, in the case of broadcast
-intents, the action that took place and is being reported. This is the only field
-in the object that must be set. The Intent class defines a number of action constants,
-including these:
+intents, the action that took place and is being reported. The Intent class defines
+a number of action constants, including these:
+</p>
-<p><table>
+<table>
<tr>
<th>Constant</th>
<th>Target component</th>
@@ -122,7 +137,7 @@ including these:
</tr><tr>
<td>{@code ACTION_MAIN}
<td>activity
- <td>Start up as the initial activity of a task.
+ <td>Start up as the initial activity of a task, with no data input and no returned output.
</tr><tr>
<td>{@code ACTION_SYNC}
<td>activity
@@ -147,45 +162,75 @@ including these:
</table>
<p>
-See the {@link android.content.Intent} class description for a full list of pre-defined action constants.
-
-<p>
-You can define action strings of your own. Those you define should include the
-application package as a prefix &mdash; for example:
-"<code>com.example.project.DEBIT_ACCT</code>". The action in an Intent object
-is set by the <code>{@link android.content.Intent#setAction setAction()}</code>
-method and read by <code>{@link android.content.Intent#getAction getAction()}</code>.
-
-<p><dt><b>Data</b></dt>
-<dd>The data to be acted on. Different actions are paired with different kinds
-of data specifications. For example, if the action field is {@code ACTION_EDIT},
+See the {@link android.content.Intent} class description for a list of
+pre-defined constants for generic actions. Other actions are defined
+elsewhere in the Android API.
+You can also define your own action strings for activating the components
+in your application. Those you invent should include the application
+package as a prefix &mdash; for example:
+"<code>com.example.project.SHOW_COLOR</code>".
+</p>
+
+<p>
+The action largely determines how the rest of the intent is structured
+&mdash; particularly the <a href="#data">data</a> and
+<a href="#extras">extras</a> fields &mdash;
+much as a method name determines a set of arguments and a return value.
+For this reason, it's a good idea to use action names that are
+as specific as possible, and to couple them tightly to the other fields of
+the intent. In other words, instead of defining an action in isolation,
+define an entire protocol for the Intent objects your components can handle.
+</p>
+
+<p>
+The action in an Intent object is set by the
+<code>{@link android.content.Intent#setAction setAction()}</code>
+method and read by
+<code>{@link android.content.Intent#getAction getAction()}</code>.
+</p>
+</dd>
+
+<p><dt><b>Data</b><a name="data"></a></dt>
+<dd>The URI of the data to be acted on and the MIME type of that data. Different
+actions are paired with different kinds of data specifications. For example, if
+the action field is {@code ACTION_EDIT},
the data field would contain the URI of the document to be displayed for editing.
If the action is {@code ACTION_CALL}, the data field would be a {@code tel:} URI
with the number to call. Similarly, if the action is {@code ACTION_VIEW} and the
-data field is a {@code mailto:} URI, the receiving activity would be called upon
-to display a screen for composing an e-mail message, with the address filled in
-from the URI.
+data field is an {@code http:} URI, the receiving activity would be called upon
+to download and display whatever data the URI refers to.
<p>
-It's often important to know the type of data (its MIME type) in addition to its URI.
-Typically, the type is inferred from the URI. But it can also be explicitly set.
+When matching an intent to a component that is capable of handling the data,
+it's often important to know the type of data (its MIME type) in addition to its URI.
+For example, a component able to display image data should not be called
+upon to play an audio file.
+</p>
+
+<p>
+In many cases, the data type can be inferred from the URI &mdash; particularly
+{@code content:} URIs, which indicate that the data is located on the device and
+controlled by a content provider (see the
+<a href="{@docRoot}guide/topics/providers/content-providers.html">separate
+discussion on content providers</a>). But the type can also be explicitly set
+in the Intent object.
The <code>{@link android.content.Intent#setData setData()}</code> method specifies
data only as a URI, <code>{@link android.content.Intent#setType setType()}</code>
specifies it only as a MIME type, and <code>{@link
android.content.Intent#setDataAndType setDataAndType()}</code> specifies it as both
-a URI and a MIME type. The data and type are read by <code>{@link
-android.content.Intent#getData getData()}</code> and <code>{@link
+a URI and a MIME type. The URI is read by <code>{@link
+android.content.Intent#getData getData()}</code> and the type by <code>{@link
android.content.Intent#getType getType()}</code>.
-
+</p>
+</dd>
<p><dt><b>Category</b></dt>
<dd>A string containing additional information about the kind of component
-that should handle the intent. Categories generally apply only to activities.
+that should handle the intent. Any number of category descriptions can be
+placed in an Intent object. As it does for actions, the Intent class defines
+several category constants, including these:
-<p>
-Any number of category descriptions can be placed in an Intent object. As it does for actions, the Intent class defines a number of category constants, including these:
-
-<p><table>
+<table>
<tr>
<th>Constant</th>
<th>Meaning</th>
@@ -211,29 +256,28 @@ Any number of category descriptions can be placed in an Intent object. As it do
</table>
<p>
-In addition to the role categories play in Intent objects, they have an
-independent function in intent filters. As the examples above suggest, they
-instruct the Android system how to treat the activity that owns the filter. For
-example, {@code CATEGORY_HOME} defines the home activity.
-
-<p>
See the {@link android.content.Intent} class description for the full list of
categories.
+</p>
<p>
The <code>{@link android.content.Intent#addCategory addCategory()}</code> method
places a category in an Intent object, <code>{@link android.content.Intent#removeCategory
removeCategory()}</code> deletes a category previously added, and <code>{@link android.content.Intent#getCategories getCategories()}</code> gets the set of all
categories currently in the object.
+</p>
+</dd>
-<p><dt><b>Extras</b></dt>
+<p><dt><b>Extras</b><a name="extras"></a></dt>
<dd>Key-value pairs for additional information that should be delivered to the
component handling the intent. Just as some actions are paired with particular
kinds of data URIs, some are paired with particular extras. For example, an
{@code ACTION_TIMEZONE_CHANGED} intent has a "{@code time-zone}" extra that
identifies the new time zone, and {@code ACTION_HEADSET_PLUG} has a
"{@code state}" extra indicating whether the headset is now plugged in or
-unplugged, as well as a "{@code name}" extra for the type of headset.
+unplugged, as well as a "{@code name}" extra for the type of headset.
+If you were to invent a {@code SHOW_COLOR} action, the color value would
+be set in an extra key-value pair.
<p>
The Intent object has a series of {@code put...()} methods for inserting various
@@ -242,12 +286,15 @@ the data. These methods parallel those for {@link android.os.Bundle} objects.
In fact, the extras can be installed and read as a Bundle using the <code>{@link
android.content.Intent#putExtras putExtras()}</code> and <code>{@link
android.content.Intent#getExtras getExtras()}</code> methods.
+</p>
+</dd>
-<p><dt><b>Launch instructions</b></dt>
-<dd>Flags that instruct the Android system how to launch an activity (for
-example, which task the activity should belong to) and how to treat it after
-it's launched (for example, whether it belongs in the list of recent activities).
-All these flags are defined in the Intent class.
+<p><dt><b>Flags</b></dt>
+<dd>Flags of various sorts. Many instruct the Android system how to launch an
+activity (for example, which task the activity should belong to) and how to treat
+it after it's launched (for example, whether it belongs in the list of recent
+activities). All these flags are defined in the Intent class.
+</dd>
</dl>
@@ -256,38 +303,89 @@ The Android system and the applications that come with the platform employ
Intent objects both to send out system-originated broadcasts and to activate
system-defined components. To see how to structure an intent to activate a
system component, consult the
-<a href="{@docRoot}../reference/available-intents.html">list of intents</a>
+<a href="{@docRoot}guide/appendix/g-app-intents.html">list of intents</a>
in the reference.
-For example, the component that initiates phone calls can be activated by an
-{@code ACTION_CALL} intent with a {@code tel:} URI specifying the phone number.
+</p>
+
+<h2><a name="ires"></a>Intent Resolution</h2>
-<h2>Intent Filters</h2>
+<p>
+Intents can be divided into two groups:
+</p>
+
+<ul>
+<li><i>Explicit intents</i> designate the target component by its
+name (the <a href="#cname">component name field</a>, mentioned earlier,
+has a value set). Since component names would generally not be known to
+developers of other applications, explicit intents are typically used
+for application-internal messages &mdash; such as an activity starting
+a subordinate service or launching a sister activity.</li>
+
+<li><p><i>Implicit intents</i> do not name a target (the field for
+the component name is blank). Implicit intents are often used to
+activate components in other applications.</p></li>
+</ul>
<p>
-If an intent explicitly names a component class, Android delivers the intent to
-an instance of that class, creating the instance if necessary. However, if the
-intent does not designate a target by name, Android must find the appropriate
-component to handle the request &mdash; a single activity or service to perform
-the requested action or the set of broadcast receivers to respond to the
-broadcast announcement. It does so by comparing the Intent object against
-components' intent filters.
+Android delivers an explicit intent to an instance of the designated
+target class. Nothing in the Intent object other than the component
+name matters for determining which component should get the intent.
+</p>
+
+<p>
+A different strategy is needed for implicit intents. In the absence of a
+designated target, the Android system must find the best component (or
+components) to handle the intent &mdash; a single activity or service to
+perform the requested action or the set of broadcast receivers to respond
+to the broadcast announcement. It does so by comparing the contents of
+the Intent object to <i>intent filters</i>, structures associated with
+components that can potentially receive intents. Filters advertise the
+capabilities of a component and delimit the intents it can handle. They
+open the component to the possibility of receiving implicit intents of
+the advertised type. If a component does not have any intent filters,
+it can receive only explicit intents. A component with filters can
+receive both explicit and implicit intents.
+</p>
+
+<p>
+Only three aspects of an Intent object are consulted when the object
+is tested against an intent filter:
+</p>
+
+<p style="margin-left: 2em">action
+<br/>data (both URI and data type)
+<br/>category</p>
+
+<p>
+The extras and flags play no part in resolving which component receives
+an intent.
+</p>
+
+
+<h3><a name="ifs"></a>Intent filters</h3>
<p>
-To inform the system which intents they can handle, activities, services, and
-broadcast receivers can have one or more intent filters.
+To inform the system which implicit intents they can handle, activities,
+services, and broadcast receivers can have one or more intent filters.
Each filter describes a capability of the component, a set of intents that
-the component is willing to receive. It, in effect, filters out unwanted
-intents. An implicit intent (one that doesn't name a target class) is delivered
-to a component only if it can pass through one of the component's filters.
-If a component lacks any intent filters, it can be activated only by explicit
-intents (those that specifically name its class).
+the component is willing to receive. It, in effect, filters in
+intents of a desired type, while filtering out unwanted
+intents &mdash; but only unwanted implicit intents (those that don't name
+a target class). An explicit intent is always delivered to its target,
+no matter what it contains; the filter is not consulted. But an implicit
+intent is delivered to a component only if it can pass through one of the
+component's filters.
+</p>
<p>
A component has separate filters for each job it can do, each face it can
-present to the user. For example, if an activity can either display
-a list of items that the user can select or display the full details of one of
-the items, it would have a separate filter for each of these possibilities.
+present to the user. For example, the principal activity of the sample
+NotePad application has three filters &mdash; one for starting up with a
+blank slate, another for starting with an assigned directory of notes
+that the user can view, edit, or select from, and a third for finding a
+particular note without an initial specification of its directory.
+</p>
<p>
An intent filter is an instance of the {@link android.content.IntentFilter} class.
@@ -298,22 +396,38 @@ Java code, but in the application's manifest file (AndroidManifest.xml) as
broadcast receivers that are registered dynamically by calling <code>{@link android.content.Context#registerReceiver(BroadcastReceiver, IntentFilter, String,
Handler) Context.registerReceiver()}</code>; they are directly created as
IntentFilter objects.)
+</p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+<h2>Filters and security</h2>
+<p>An intent filter cannot be relied on for security. While it opens a
+component to receiving only certain kinds of implicit intents, it does
+nothing to prevent explicit intents from targeting the component. Even
+though a filter restricts the intents a component will be asked to handle
+to certain actions and data sources, someone could always put
+together an explicit intent with a different action and data source, and
+name the component as the target.
+</p>
+</div>
+</div>
<p>
A filter has fields that parallel the action, data, and category fields of an
-Intent object. A new intent is tested against the filter in all three areas.
+Intent object. An implicit intent is tested against the filter in all three areas.
To be delivered to the component that owns the filter, it must pass all three tests.
If it fails even one of them, the Android system won't deliver it to the
component &mdash; at least not on the basis of that filter. However, since a
-component can have multiple intent filters, an arriving intent that does not pass
+component can have multiple intent filters, an intent that does not pass
through one of a component's filters might make it through on another.
+</p>
<p>
Each of the three tests is described in detail below:
+</p>
<dl>
-<p>
<dt><b>Action test</b></dt>
<dd>An {@code &lt;intent-filter&gt;} element in the manifest file lists actions
as {@code &lt;action&gt;} subelements. For example:
@@ -327,15 +441,28 @@ as {@code &lt;action&gt;} subelements. For example:
<p>
As the example shows, while an Intent object names just a single action,
-a filter may list more than one &mdash; or it may not list any at all.
+a filter may list more than one. The list cannot be empty; a filter must
+contain at least one {@code &lt;action&gt;} element, or it
+will block all intents.
+</p>
<p>
-To pass this test, the action specified in the {@link android.content.Intent}
-object must match one of the actions listed in the filter. However, if the
-filter doesn't list any actions, all actions are accepted, so all intents pass
-the test.
+To pass this test, the action specified in the Intent object must match
+one of the actions listed in the filter. If the object or the filter
+does not specify an action, the results are as follows:
+</p>
+
+<ul>
+<li>If the filter fails to list any actions, there is nothing for an
+intent to match, so all intents fail the test. No intents can get
+through the filter.</li>
+
+<li><p>On the other hand, an Intent object that doesn't specify an
+action automatically passes the test &mdash; as long as the filter
+contains at least one action.</p></li>
+</ul
+</dd>
-<p>
<dt><b>Category test</b></dt>
<dd>An {@code &lt;intent-filter&gt;} element also lists categories as subelements.
For example:
@@ -346,110 +473,217 @@ For example:
. . .
&lt;/intent-filter&gt;</pre>
-<p>Note that the constants described earlier for actions and categories are not
+<p>
+Note that the constants described earlier for actions and categories are not
used in the manifest file. The full string values are used instead. For
instance, the "{@code android.intent.category.BROWSABLE}" string in the example
above corresponds to the {@code CATEGORY_BROWSABLE} constant mentioned earlier
in this document. Similarly, the string "{@code android.intent.action.EDIT}"
corresponds to the {@code ACTION_EDIT} constant.
-
-<p>
-Many categories tell the Android system how to treat the component. For example,
-"{@code android.intent.category.LAUNCHER}" (the {@code CATEGORY_LAUNCHER} constant
-in code) instructs the system to include the activity in the screen showing
-applications the user can launch. Some categories &mdash; like "{@code
-android.intent.category.DEFAULT}" in the example above &mdash typically appear
-only in filters, not in Intent objects.
+</p>
<p>
For an intent to pass the category test, every category in the Intent object
must match a category in the filter. The filter can list additional categories,
-but it cannot omit any in the intent. An intent with no
-categories always passes this test, regardless of what's in the filter.
+but it cannot omit any that are in the intent.
+</p>
+
+<p>
+In principle, therefore, an Intent object with no categories should always pass
+this test, regardless of what's in the filter. That's mostly true. However,
+with one exception, Android treats all implicit intents passed to {@link
+android.content.Context#startActivity startActivity()} as if they contained
+at least one category: "{@code android.intent.category.DEFAULT}" (the
+{@code CATEGORY_DEFAULT} constant).
+Therefore, activities that are willing to receive implicit intents must
+include "{@code android.intent.category.DEFAULT}" in their intent filters.
+(Filters with "{@code android.intent.action.MAIN}" and
+"{@code android.intent.category.LAUNCHER}" settings are the exception.
+They mark activities that begin new tasks and that are represented on the
+launcher screen. They can include "{@code android.intent.category.DEFAULT}"
+in the list of categories, but don't need to.) See <a href="#imatch">Using
+intent matching</a>, later, for more on these filters.)
+</p>
+<dd>
-<p>
<dt><b>Data test</b></dt>
<dd>Like the action and categories, the data specification for an intent filter
is contained in a subelement. And, as in those cases, the subelement can appear
multiple times, or not at all. For example:
<pre>&lt;intent-filter . . . &gt;
- &lt;data android:scheme="content"
- android:host="com.example"
- android:path="folder/*" . . . /&gt;
- &lt;data android:scheme="content"
- android:type="image/jpeg" . . . /&gt;
+ &lt;data android:type="video/mpeg" android:scheme="http" . . . /&gt;
+ &lt;data android:type="audio/mpeg" android:scheme="http" . . . /&gt;
. . .
&lt;/intent-filter&gt;</pre>
<p>
-Each {@code &lt;data&gt;} element can specify a URI and a data type (MIME type).
+Each {@code &lt;data&gt;} element can specify a URI and a data type (MIME media type).
There are separate attributes &mdash; {@code scheme}, {@code host}, {@code port},
and {@code path} &mdash; for each part of the URI:
+</p>
-<dl><dd>{@code scheme://host:port/path}</dd></dl>
+<p style="margin-left: 2em">{@code scheme://host:port/path}</p>
<p>
For example, in the following URI,
+</p>
-<dl><dd>{@code content://com.example.project:200/folder/subfolder/etc}</dd></dl>
+<p style="margin-left: 2em">{@code content://com.example.project:200/folder/subfolder/etc}</p>
<p> the scheme is "{@code content}", the host is "{@code com.example.project}",
the port is "{@code 200}", and the path is "{@code folder/subfolder/etc}".
The host and port together constitute the URI <i>authority</i>; if a host is
not specified, the port is ignored.
+</p>
<p>
Each of these attributes is optional, but they are not independent of each other:
For an authority to be meaningful, a scheme must also be specified.
For a path to be meaningful, both a scheme and an authority must be specified.
+</p>
<p>
When the URI in an Intent object is compared to a URI specification in a filter,
-it's compared only to the parts of the URI actually specified in the filter.
+it's compared only to the parts of the URI actually mentioned in the filter.
For example, if a filter specifies only a scheme, all URIs with that scheme match
the filter. If a filter specifies a scheme and an authority but no path, all URIs
with the same scheme and authority match, regardless of their paths. If a filter
specifies a scheme, an authority, and a path, only URIs with the same scheme,
authority, and path match. However, a path specification in the filter can
contain wildcards to require only a partial match of the path.
+</p>
<p>
-A {@code &lt;data&gt;} element specifies a MIME type with the {@code type} attribute.
-Both the Intent object and the filter can use the '*" wildcard for the subtype field
-&mdash; for example, "{@code text/*}" or "{@code image/*}" &mdash; indicating any
-subtype matches.
+The {@code type} attribute of a {@code &lt;data&gt;} element specifies the MIME type
+of the data. It's more common in filters than a URI. Both the Intent object and
+the filter can use a "*" wildcard for the subtype field &mdash; for example,
+"{@code text/*}" or "{@code audio/*}" &mdash; indicating any subtype matches.
+</p>
<p>
The data test compares both the URI and the data type in the Intent object to a URI
and data type specified in the filter. The rules are as follows:
+</p>
-<ul>
+<ol type="a">
+<li>An Intent object that contains neither a URI nor a data type passes the
+test only if the filter likewise does not specify any URIs or data types.</li>
-<p><li>An Intent object that contains neither a URI nor a data type passes the
-test only if the filter likewise does not specify any URIs or data types.
-
-<p><li>An Intent object that contains a URI but no data type (and a type cannot
+<li><p>An Intent object that contains a URI but no data type (and a type cannot
be inferred from the URI) passes the test only if its URI matches a URI in the
filter and the filter likewise does not specify a type. This will be the case
-only for URIs like {@code mailto:} and {@code tel:} that do not refer to actual data.
+only for URIs like {@code mailto:} and {@code tel:} that do not refer to actual data.</p></li>
-<p><li>An Intent object that contains a data type but not a URI passes the test
-only if the filter lists the same data type and similarly does not specify a URI.
+<li><p>An Intent object that contains a data type but not a URI passes the test
+only if the filter lists the same data type and similarly does not specify a URI.</p></li>
-<p><li>An Intent object that contains both a URI and a data type (or a data type
+<li><p>An Intent object that contains both a URI and a data type (or a data type
can be inferred from the URI) passes the data type part of the test only if its
type matches a type listed in the filter. It passes the URI part of the test
either if its URI matches a URI in the filter or if it has a {@code content:}
or {@code file:} URI and the filter does not specify a URI. In other words,
a component is presumed to support {@code content:} and {@code file:} data if
-its filter list only a data type.
+its filter lists only a data type.</p></li>
+</ol>
+</dl>
+
+<p>
+If an intent can pass through the filters of more than one activity or service,
+the user may be asked which component to activate. An exception is raised if
+no target can be found.
+</p>
+
+
+<h3><a name="ccases"></a>Common cases</h3>
+
+<p>
+The last rule shown above for the data test, rule (d), reflects the expectation
+that components are able to get local data from a file or content provider.
+Therefore, their filters can list just a data type and do not need to explicitly
+name the {@code content:} and {@code file:} schemes.
+This is a typical case. A {@code &lt;data&gt;} element like the following,
+for example, tells Android that the component can get image data from a content
+provider and display it:
+</p>
+
+<pre>&lt;data android:type="image/*" /&gt;</pre>
-</ul>
+<p>
+Since most available data is dispensed by content providers, filters that
+specify a data type but not a URI are perhaps the most common.
+</p>
+
+<p>
+Another common configuration is filters with a scheme and a data type. For
+example, a {@code &lt;data&gt;} element like the following tells Android that
+the component can get video data from the network and display it:
+</p>
+
+<pre>&lt;data android:scheme="http" android:type="video/*" /&gt;</pre>
+
+<p>
+Consider, for example, what the browser application does when
+the user follows a link on a web page. It first tries to display the data
+(as it could if the link was to an HTML page). If it can't display the data,
+it puts together an implicit intent with the scheme and data type and tries
+to start an activity that can do the job. If there are no takers, it asks the
+download manager to download the data. That puts it under the control
+of a content provider, so a potentially larger pool of activities
+(those with filters that just name a data type) can respond.
+</p>
<p>
-If an intent can pass through the filters of more than one component, the user
-may be asked which component to activate.
+Most applications also have a way to start fresh, without a reference
+to any particular data. Activities that can initiate applications
+have filters with "{@code android.intent.action.MAIN}" specified as
+the action. If they are to be represented in the application launcher,
+they also specify the "{@code android.intent.category.LAUNCHER}"
+category:
+</p>
+
+<pre>&lt;intent-filter . . . &gt;
+ &lt;action android:name="code android.intent.action.MAIN" /&gt;
+ &lt;category android:name="code android.intent.category.LAUNCHER" /&gt;
+&lt;/intent-filter&gt;</pre>
+
+
+<h3><a name="imatch"></a>Using intent matching</h3>
+
+<p>
+Intents are matched against intent filters not only to discover a target
+component to activate, but also to discover something about the set of
+components on the device. For example, the Android system populates the
+application launcher, the top-level screen that shows the applications
+that are available for the user to launch, by finding all the activities
+ with intent filters that specify the "{@code android.intent.action.MAIN}"
+action and "{@code android.intent.category.LAUNCHER}" category
+(as illustrated in the previous section). It then displays the icons and
+labels of those activities in the launcher. Similarly, it discovers the
+home screen by looking for the activity with
+"{@code android.intent.category.HOME}" in its filter.
+</p>
+
+<p>
+Your application can use intent matching is a similar way.
+The {@link android.content.pm.PackageManager} has a set of {@code query...()}
+methods that return all components that can accept a particular intent, and
+a similar series of {@code resolve...()} methods that determine the best
+component to respond to an intent. For example,
+{@link android.content.pm.PackageManager#queryIntentActivities
+queryIntentActivities()} returns a list of all activities that can perform
+the intent passed as an argument, and {@link
+android.content.pm.PackageManager#queryIntentServices
+queryIntentServices()} returns a similar list of services.
+Neither method activates the components; they just list the ones that
+can respond. There's a similar method,
+{@link android.content.pm.PackageManager#queryBroadcastReceivers
+queryBroadcastReceivers()}, for broadcast receivers.
+</p>
+
+
+
+
diff --git a/docs/html/guide/topics/location/geo/mapkey.jd b/docs/html/guide/topics/location/geo/mapkey.jd
new file mode 100644
index 0000000..110876f
--- /dev/null
+++ b/docs/html/guide/topics/location/geo/mapkey.jd
@@ -0,0 +1,28 @@
+page.title=Obtaining a MapView API Key
+@jd:body
+
+<p>{@link-fixme com.google.android.maps.MapView} is a very useful class that lets you easily integrate Google Maps into your application. It provides built-in map downloading, rendering, and caching, as well as a variety of display options and controls. It provides a wrapper around the Google Maps API that lets your application request and manipulate Google Maps data through class methods, and it lets you work with Maps data as you would other types of Views. </p>
+
+<p>Because MapView gives you access to Google Maps data, you need to register your application with the Google Maps service and agree to the applicable Terms of Service, before your MapView will be able to obtain data from Google Maps. This will apply whether you are developing your application on the emulator or preparing your application for deployment to mobile devices. </p>
+
+<p>Registering your application is simple, and has two parts: </p>
+
+<ol>
+<li>Registering a public key fingerprint from the certificate that you will use to sign the .apk. The registration service then provides you a Maps API Key that is associated with your application's signer certificate. </li>
+<li>Adding the Maps API Key to a special attribute of the MapView element &mdash; <code>android:apiKey</code>. You can use the same Maps API Key for any MapView in any application, provided that the application's .apk is signed with the certificate whose fingerprint you registered with the service. </li>
+</ol>
+
+<p>Once you have registered your application as described above, your MapView will be able to retrieve data from the Google Maps servers. </p>
+
+<div class="special">
+<p>The MapView registration service is not yet active and Google Maps is not yet enforcing the Maps API Key requirement. 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, this page (<a href="http://code.google.com/android/toolbox/apis/mapkey.html">http://code.google.com/android/toolbox/apis/mapkey.html</a>) will be updated with details about how and where to register and how to add your Maps API Key to your application. </p>
+
+<p>In the meantime, you can continue developing your MapView without registration, provided that you:</p>
+<ol type="a">
+<li>Add the attribute "android:apiKey" to the MapView element in your layout XML, with any value. Or</li>
+<li>Include an arbitrary string in the <code>apikey</code> parameter of the MapView constructor, if creating the MapView programmatically. </li>
+</ol>
+
+<p>When the Maps API Key checking is activated in the service, any MapViews that do not have a properly registered apiKey will stop working. The map data (tile images) of the MapView will never load (even if the device is on the network). In this case, go to the page linked above and read about how to register your certificate fingerprint and obtain a Maps API Key. </p>
diff --git a/docs/html/guide/topics/location/index.jd b/docs/html/guide/topics/location/index.jd
new file mode 100644
index 0000000..eeaab39
--- /dev/null
+++ b/docs/html/guide/topics/location/index.jd
@@ -0,0 +1,109 @@
+page.title=Location
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#location">android.location</a></li>
+ <li><a href="#maps">com.google.android.maps</a></li>
+ </ol>
+</div>
+</div>
+
+<p>The Android SDK includes two packages that provide Android's primary support
+for building location-based services:
+{@link android.location} and {@link-fixme com.google.android.maps}.
+Please read on below for a brief introduction to each package.</p>
+
+<h2 id="location">android.location</h2>
+
+<p>This package contains several classes related to
+location services in the Android platform. Most importantly, it introduces the
+{@link android.location.LocationManager}
+service, which provides an API to determine location and bearing if the
+underlying device (if it supports the service). The LocationManager
+should <strong>not</strong> be
+instantiated directly; rather, a handle to it should be retrieved via
+{@link android.content.Context#getSystemService(String)
+getSystemService(Context.LOCATION_SERVICE)}.</p>
+
+<p>Once your application has a handle to the LocationManager, your application
+will be able to do three things:</p>
+
+<ul>
+ <li>Query for the list of all LocationProviders known to the
+ LocationManager for its last known location.</li>
+ <li>Register/unregister for periodic updates of current location from a
+ LocationProvider (specified either by Criteria or name).</li>
+ <li>Register/unregister for a given Intent to be fired if the device comes
+ within a given proximity (specified by radius in meters) of a given
+ lat/long.</li>
+</ul>
+
+<p>However, during initial development, you may not have access to real
+data from a real location provider (Network or GPS). So it may be necessary to
+spoof some data for your application, with some mock location data.</p>
+
+<p class="note"><strong>Note:</strong> If you've used mock LocationProviders in
+previous versions of the SDK (m3/m5), you can no longer provide canned LocationProviders
+in the /system/etc/location directory. These directories will be wiped during boot-up.
+Please follow the new procedures below.</p>
+
+
+<h3>Providing Mock Location Data</h3>
+
+<p>When testing your application on the Android emulator, there are a couple different
+ways to send it some spoof location data: with the DDMS tool or the "geo" command.</p>
+
+<h4 id="ddms">Using DDMS</h4>
+<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 placemarks for sequenced playback to the device.</li>
+</ul>
+<p>For more information on using DDMS to spoof location data, see the
+<a href="{@docRoot}guide/developing/tools/ddms.html#emulator-control">Using DDMS guide</a>.
+
+<h4 id="geo">Using the "geo" command</h4>
+<p>Launch your application in the Android emulator and open a terminal/console in
+your SDK's <code>/tools</code> directory. Now you can use:</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>
+
+
+<h2 id="maps">com.google.android.maps</h2>
+
+<p>This package introduces a number of classes related to
+rendering, controlling, and overlaying customized information on your own
+Google Mapified Activity. The most important of which is the
+{@link-fixme com.google.android.maps.MapView} class, which automagically draws you a
+basic Google Map when you add a MapView to your layout. Note that, if you
+want to do so, then your Activity that handles the
+MapView must extend {@link-fixme com.google.android.maps.MapActivity}. </p>
+
+<p>Also note that you must obtain a MapView API Key from the Google Maps
+service, before your MapView can load maps data. For more information, see
+<a href="{@docRoot}guide/developing/mapkey.html">Obtaining a MapView API Key</a>.</p>
+
+<p>Once you've created a MapView, you'll probably want to use
+{@link-fixme com.google.android.maps.MapView#getController()} to
+retrieve a {@link-fixme com.google.android.maps.MapController}, for controlling and
+animating the map, and {@link-fixme com.google.android.maps.ItemizedOverlay} to
+draw {@link-fixme com.google.android.maps.Overlay}s and other information on the Map.</p>
+
+<p>This is not a standard package in the Android library. In order to use it, you must add the following node to your Android Manifest file, as a child of the
+<code>&lt;application></code> element:</p>
+<pre>&lt;uses-library android:name="com.google.android.maps" /></pre>
+
diff --git a/docs/html/guide/topics/manifest/manifest.jd b/docs/html/guide/topics/manifest/manifest.jd
index 2cf1976..bf9194c 100644
--- a/docs/html/guide/topics/manifest/manifest.jd
+++ b/docs/html/guide/topics/manifest/manifest.jd
@@ -1,183 +1,3063 @@
-page.title=The Manifest File (AndroidManifest.xml)
+page.title=The AndroidManifest.xml File
@jd:body
-<p>Every Android application has a <em>manifest file</em> that declares global values for the application.
-For example, the manifest file declares the appliication's fully qualified package name, as well as the application components (activities, services, etc) it exposes, the implementation classes for each, the kinds of data each can handle,
-and where they can be launched. </p>
-
-<p>The manifest is an XML file that is always stored under the name <code>AndroidManifest.xml</code> in the root folder of the application. Only one manifest file is allowed per application package. As part of developing your android application, you will be creating the application's manifest file using the XML vocabulary described in this document. </p>
-
-<p>An important aspect of this file is the <em>intent filters</em> that it includes.
- These filters describe where and when that activity can be started. When an activity
- (or the operating system) wants to perform an action such as open a Web page
- or open a contact picker screen, it creates an {@link android.content.Intent
- Intent} object. This object can hold several descriptors describing what you
- want to do, what data you want to do it to, the type of data, and other bits
- of information. Android compares the information in an Intent object with the
- intent filter exposed by every application and finds the activity most appropriate
- to handle the data or action specified by the caller. More details
- on intents is given in the {@link android.content.Intent
- Intent} reference page.</p>
-
-<p>Besides declaring your application's activities, content providers, services,
-and intent receivers, you can also specify permissions and instrumentation
-(security control and testing) in AndroidManifest.xml. For a reference of the tags and
-their attributes, please see {@link android.R.styleable#AndroidManifest}.</p>
-
-<p>A simple AndroidManifest.xml looks like this:</p>
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+<li><a href="#filestruct">Structure of the Manifest File</a></li>
+<li><a href="#filef">File Features</a>
+ <ol>
+ <li><a href="#ifs">Intent Filter</a></li>
+ <li><a href="#iconlabel">Icons and Labels</a></li>
+ <li><a href="#perms">Using Permissions</a></li>
+ <li><a href="#libs">Libraries</a></li>
+ </ol></li>
+<li><a href="#elems">Elements of the Manifest File</a></li>
+</ol>
+</div>
+</div>
+
+<p>
+Every application must have an AndroidManifest.xml file (with precisely that
+name) in its root directory. The manifest presents essential information about
+the application to the Android system, information the system must have before
+it can run any of the application's code. Among other things, the manifest
+does the following:
+</p>
+
+<ul>
+<li>It names the Java package for the application.
+The package name serves as a unique identifier for the application.</li>
+
+<li>It describes the components of the application &mdash; the activities,
+services, broadcast receivers, and content providers that the application is
+composed of. It names the classes that implement each of the components and
+publishes their capabilities (for example, which {@link android.content.Intent
+Intent} messages they can handle). These declarations let the Android system
+know what the components are and under what conditions they can be launched.</li>
+
+<li>It determines which processes will host application components.</li>
+
+<li>It declares which permissions the application must have in order to
+access protected parts of the API and interact with other applications.</li>
+
+<li>It also declares the permissions that others are required to have in
+order to interact with the application's components.</li>
+
+<li>It lists the {@link android.app.Instrumentation} classes that provide
+profiling and other information as the application is running. These declarations
+are present in the manifest only while the application is being developed and
+tested; they're removed before the application is published.</li>
+
+<li>It declares the minimum version of the Android API that the application
+requires.</li>
+
+<li>It lists the libraries that the application must be linked against.</li>
+</ul>
+
+
+<h2 id="filestruct">Structure of the Manifest File</h2>
+
+<p>
+A later section of this document, <a href="#elems">"Elements of the Manifest
+File"</a>, describes all of the elements that can appear in the manifest file
+and each of their attributes. The diagram below shows the general structure of
+the file and every element it can contain.
+</p>
<pre>
&lt;?xml version="1.0" encoding="utf-8"?&gt;
-&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.my_domain.app.helloactivity"&gt;
-
- &lt;application android:label="@string/app_name"&gt;
-
- &lt;activity android:name=".HelloActivity"&gt;
- &lt;intent-filter&gt;
- &lt;action android:name="android.intent.action.MAIN"/&gt;
- &lt;category android:name="android.intent.category.LAUNCHER"/&gt;
- &lt;/intent-filter&gt;
+<a href="#manf">&lt;manifest&gt;</a>
+
+ <a href="#usesp">&lt;uses-permission /&gt;</a>
+ <a href="#prmsn">&lt;permission /&gt;</a>
+ <a href="#ptree">&lt;permission-tree /&gt;</a>
+ <a href="#pgroup">&lt;permission-group /&gt;</a>
+
+ <a href="#instru">&lt;instrumentation /&gt;</a>
+
+ <a href="#usess">&lt;uses-sdk /&gt;</a>
+
+ <a href="#app">&lt;application&gt;</a>
+
+ <a href="#actv">&lt;activity&gt;</a>
+ <a href="#ifilt">&lt;intent-filter&gt;</a>
+ <a href="#actn">&lt;action /&gt;</a>
+ <a href="#catg">&lt;category /&gt;</a>
+ <a href="#data">&lt;data /&gt;</a>
+ <a href="#ifilt">&lt;/intent-filter&gt;</a>
+ <a href="#meta">&lt;meta-data /&gt;</a>
+ <a href="#actv">&lt;/activity&gt;</a>
+
+ <a href="#alias">&lt;activity-alias&gt;</a>
+ <a href="#ifilt">&lt;intent-filter&gt;</a> . . . <a href="#ifilt">&lt;/intent-filter&gt;</a>
+ <a href="#meta">&lt;meta-data /&gt;</a>
+ <a href="#alias">&lt;/activity-alias&gt;</a>
+
+ <a href="#srvc">&lt;service&gt;</a>
+ <a href="#ifilt">&lt;intent-filter&gt;</a> . . . <a href="#ifilt">&lt;/intent-filter&gt;</a>
+ <a href="#meta">&lt;meta-data/&gt;</a>
+ <a href="#srvc">&lt;/service&gt;</a>
+
+ <a href="#rcvr">&lt;receiver&gt;</a>
+ <a href="#ifilt">&lt;intent-filter&gt;</a> . . . <a href="#ifilt">&lt;/intent-filter&gt;</a>
+ <a href="#meta">&lt;meta-data /&gt;</a>
+ <a href="#rcvr">&lt;/receiver&gt;</a>
+
+ <a href="#pvdr">&lt;provider&gt;</a>
+ <a href="#grantp">&lt;grant-uri-permission /&gt;</a>
+ <a href="#meta">&lt;meta-data /&gt;</a>
+ <a href="#pvdr">&lt;/provider&gt;</a>
+
+ <a href="#usesl">&lt;uses-library /&gt;</a>
+
+ <a href="#app">&lt;/application&gt;</a>
+
+<a href="#manf">&lt;/manifest&gt;</a>
+</pre>
+
+<p>
+Some conventions and rules apply generally to all elements and attributes
+in the manifest:
+</p>
+
+<dl>
+<dt><b>Elements</b></dt>
+<dd>Only the {@code <a href="#manf">&lt;manifest&gt;</a>} and
+{@code <a href="#app">&lt;application&gt;</a>} elements are required, they each
+must be present and can occur only once. Most of the others can occur many times
+or not at all &mdash; although at least some of them must be present for the
+manifest to accomplish anything meaningful.
+
+<p>
+If an element contains anything at all, it contains other elements.
+All values are set through attributes, not as character data within an element.
+</p>
+
+<p>
+Elements at the same level are generally not ordered. For example,
+{@code <a href="#actv">&lt;activity&gt;</a>},
+{@code <a href{@code <a href="#pvdr">&lt;provider&gt;</a>}, and
+{@code <a href="#srvc">&lt;service&gt;</a>} elements can be intermixed in
+any sequence. (An {@code <a href="#alias">&lt;activity-alias&gt;</a>} is the
+exception to this rule: It must follow the {@code <a href="#actv">&lt;activity&gt;</a>}
+it is an alias for.)</p></dd>
+
+<dt><b>Attributes</b></dt>
+<dd>In a formal sense, all attributes are optional. However, there are some
+that must be specified for an element to accomplish its purpose. Use the
+documentation as a guide. For truly optional attributes, it mentions a default
+value or states what happens in the absence of a specification.
+
+<p>Except for some attributes of
+the root {@code <a href="#manf">&lt;manifest&gt;</a>} element,
+all attribute names begin with an {@code android:} prefix &mdash;
+for example, {@code android:alwaysRetainTaskState}. Because the prefix is
+universal, this documentation generally omits it when referring to attributes
+by name.</p></dd>
+
+<dt><b>Declaring class names</b></dt>
+<dd>Many elements correspond to Java objects, including elements for the
+application itself (the {@code <a href="#app">&lt;application&gt;</a>} element)
+and its principal components &mdash;
+activities ({@code <a href="#actv">&lt;activity&gt;</a>}),
+services ({@code <a href="#srvc">&lt;service&gt;</a>}),
+broadcast receivers ({@code <a href="#rcvr">&lt;receiver&gt;</a>}),
+and content providers ({@code <a href="#pvdr">&lt;provider&gt;</a>}).
+
+<p>
+If you define a subclass, as you almost always would for the component classes
+({@link android.app.Activity}, {@link android.app.Service},
+{@link android.content.BroadcastReceiver},
+and {@link android.content.ContentProvider}), the subclass is declared through
+a {@code name} attribute. The name must include the full package designation.
+For example, an {@link android.app.Service} subclass might be declared as follows:
+</p>
+
+<pre>&lt;manifest . . . &gt;
+ &lt;application . . . &gt;
+ &lt;service android:name="com.example.project.SecretService" . . . &gt;
+ . . .
+ &lt;/service&gt;
+ . . .
+ &lt;/application&gt;
+&lt;/manifest&gt;</pre>
+
+<p>
+However, as a shorthand, if the first character of the string is a period, the
+string is appended to the application's package name (as specified by the
+{@code <a href="#manf">&lt;manifest&gt;</a>} element's
+{@code <a href="#manf_package">package</a>} attribute). The following assignment
+is the same as the one above:
+</p>
+
+<pre>&lt;manifest package="com.example.project" . . . &gt;
+ &lt;application . . . &gt;
+ &lt;service android:name=".SecretService" . . . &gt;
+ . . .
+ &lt;/service&gt;
+ . . .
+ &lt;/application&gt;
+&lt;/manifest&gt;</pre>
+
+<p>
+When starting a component, Android creates an instance of the named subclass.
+If a subclass isn't specified, it creates an instance of the base class.
+</p></dd>
+
+<dt><b>Multiple values</b></dt>
+<dd>If more than one value can be specified, the element is almost always repeated,
+rather than listing multiple values within a single element.
+For example, an intent filter can list several actions:
+
+<pre>&lt;intent-filter . . . &gt;
+ &lt;action android:name="android.intent.action.EDIT" /&gt;
+ &lt;action android:name="android.intent.action.INSERT" /&gt;
+ &lt;action android:name="android.intent.action.DELETE" /&gt;
+ . . .
+&lt;/intent-filter&gt;</pre></dd>
+
+<dt><b>Resource values</b></dt>
+<dd>Some attributes have values that can be displayed to users &mdash; for
+example, a label and an icon for an activity. The values of these attributes
+should be localized and therefore set from a resource or theme. Resource values
+are expressed in the following format,</p>
+
+<p style="margin-left: 2em">{@code @[<i>package</i>:]<i>type</i>:<i>name</i>}</p>
+
+<p>
+where the <i>package</i> name can be omitted if the resource is in the same package
+as the application, <i>type</i> is a type of resource &mdash; such as "string" or
+"drawable" &mdash; and <i>name</i> is the name that identifies the specific resource.
+For example:
+</p>
+
+<pre>&lt;activity android:icon="@drawable/smallPic" . . . &gt</pre>
+
+<p>
+Values from a theme are expressed in a similar manner, but with an initial '?'
+rather than '@':
+</p>
+
+<p style="margin-left: 2em">{@code ?[<i>package</i>:]<i>type</i>:<i>name</i>}
+</p></dd>
+
+<dt><b>String values</b></dt>
+<dd>Where an attribute value is a string, double backslashes ('{@code \\}')
+must be used to escape characters &mdash; for example, '{@code \\n}' for
+a newline or '{@code \\uxxxx}' for a Unicode character.</dd>
+</dl>
+
+
+<h2 id="filef">File Features</h2>
+
+<p>
+The following sections describe how some Android features are reflected
+in the manifest file.
+</p>
+
+
+<h3 id="ifs">Intent Filters</h3>
+
+<p>
+The core components of an application (its activities, services, and broadcast
+receivers) are activated by <i>intents</i>. An intent is a
+bundle of information (an {@link android.content.Intent} object) describing a
+desired action &mdash; including the data to be acted upon, the category of
+component that should perform the action, and other pertinent instructions.
+Android locates an appropriate component to respond to the intent, launches
+a new instance of the component if one is needed, and passes it the
+Intent object.
+</p>
+
+<p>
+Components advertise their capabilities &mdash; the kinds of intents they can
+respond to &mdash; through <i>intent filters</i>. Since the Android system
+must learn which intents a component can handle before it launches the component,
+intent filters are specified in the manifest as
+{@code <a href="#ifilt">&lt;intent-filter&gt;</a>} elements. A component may
+have any number of filters, each one describing a different capability.
+</p>
+
+<p>
+An intent that explicitly names a target component will activate that component;
+the filter doesn't play a role. But an intent that doesn't specify a target by
+name can activate a component only if it can pass through one of the component's
+filters.
+</p>
+
+<p>
+For information on how Intent objects are tested against intent filters,
+a separate document,
+<a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents
+and Intent Filters</a>.
+</p>
+
+
+<h3 id="iconlabel">Icons and Labels</h3>
+
+<p>
+A number of elements have {@code icon} and {@code label} attributes for an
+icon and a text label that can displayed to users. Some also have a
+{@code description} attribute for longer explanatory text that can also be
+shown on-screen. For example, the {@code <a href="#prmsn">&lt;permission&gt;</a>}
+element has all three of these attributes, so that when the user is asked whether
+to grant the permission to an application that has requested it, an icon representing
+the permission, the name of the permission, and a description of what it
+entails can all be presented to the user.
+</p>
+
+<p>
+In every case, the icon and label set in a containing element become the default
+{@code icon} and {@code label} settings for all of the container's subelements.
+Thus, the icon and label set in the {@code <a href="#app">&lt;application&gt;</a>}
+element are the default icon and label for each of the application's components.
+Similarly, the icon and label set for a component &mdash; for example, an
+{@code <a href="#actv">&lt;activity&gt;</a>} element &mdash; are the default
+settings for each of the component's
+{@code <a href="#ifilt">&lt;intent-filter&gt;</a>} elements. If an
+{@code <a href="#app">&lt;application&gt;</a>} element sets a label, but
+an activity and its intent filter do not, the application label is treated
+as the label for both the activity and the intent filter.
+</p>
+
+<p>
+The icon and label set for an intent filter are used to represent a component
+whenever the component is presented to the user as fulfilling the function
+advertised by the filter. For example, a filter with
+"{@code android.intent.action.MAIN}" and
+"{@code android.intent.category.LAUNCHER}" settings advertises an activity
+as one that initiates an application &mdash; that is, as
+one that should be displayed in the application launcher. The icon and label
+set in the filter are therefore the ones displayed in the launcher.
+</p>
+
+
+<h3 id="perms">Permissions</h3>
+
+<p>
+A <i>permission</i> is a restriction limiting access to a part of the code
+or to data on the device. The limitation is imposed to protect critical
+data and code that could be misused to distort or damage the user experience.
+</p>
+
+<p>
+Each permission is identified
+by a unique label. Often the label indicates the action that's restricted.
+For example, here are some permissions defined by Android:
+</p>
+
+<p style="margin-left: 2em">{@code android.permission.CALL_EMERGENCY_NUMBERS}
+<br/>{@code android.permission.READ_OWNER_DATA}
+<br/>{@code android.permission.SET_WALLPAPER}
+<br/>{@code android.permission.DEVICE_POWER}</p>
+
+<p>
+A feature can be protected by at most one permission.
+</p>
+
+<p>
+If an application needs access to a feature protected by a permission, it must
+declare that it requires that permission with a
+{@code <a href="#usesp">&lt;uses-permission&gt;</a>} element in the manifest.
+Then, when the application is installed on the device, the installer determines
+whether or not to grant the requested permission by checking the authorities that
+signed the application's certificates and, in some cases, asking the user.
+If the permission is granted, the application is able to use the protected
+features. If not, its attempts to access those features will simply fail
+without any notification to the user.
+</p>
+
+<p>
+An application can also protect its own components (activities, services,
+broadcast receivers, and content providers) with permissions. It can employ
+any of the permissions defined by Android (listed in
+{@link android.Manifest.permission android.Manifest.permission}) or declared
+by other applications. Or it can define its own. A new permission is declared
+with the {@code <a href="#prmsn">&lt;permission&gt;</a>} element.
+For example, an activity could be protected as follows:
+</p>
+
+<pre>
+&lt;manifest . . . &gt;
+ &lt;permission android:name="com.example.project.DEBIT_ACCT" . . . /&gt;
+ . . .
+ &lt;application . . .&gt;
+ &lt;activity android:name="com.example.project.FreneticActivity" . . . &gt;
+ android:permission="com.example.project.DEBIT_ACCT"
+ . . . &gt;
+ . . .
&lt;/activity&gt;
-
&lt;/application&gt;
-
+ . . .
+ &lt;uses-permission android:name="com.example.project.DEBIT_ACCT" /&gt;
+ . . .
&lt;/manifest&gt;
</pre>
-<p>Some general items to note:</p>
+<p>
+Note that, in this example, the {@code DEBIT_ACCT} permission is not only
+declared with the {@code <a href="#prmsn">&lt;permission&gt;</a>}
+element, its use is also requested with
+the {@code <a href="#usesp">&lt;uses-permission&gt;</a>} element. Its use
+must be requested in order for other components of the application to launch
+the protected activity, even though the protection is imposed by the
+application itself.
+</p>
+
+<p>
+If, in the same example, the {@code permission} attribute was set to a
+permission declared elsewhere
+(such as {@code android.permission.CALL_EMERGENCY_NUMBERS}, it would not
+have been necessary to declare it again with the
+{@code <a href="#prmsn">&lt;permission&gt;</a>} element.
+However, it would still have been necessary to request its use with
+{@code <a href="#usesp">&lt;uses-permission&gt;</a>}.
+</p>
+
+<p>
+The {@code <a href="#ptree">&lt;permission-tree&gt;</a>} element declares
+a namespace for a group of permissions that will be defined in code.
+And {@code <a href="#pgroup">&lt;permission-group&gt;</a>}
+defines a label for a set of permissions (both those declared in the
+manifest with {@code <a href="#prmsn">&lt;permission&gt;</a>} elements and
+those declared elsewhere). It affects only how the permissions are grouped
+when presented to the user.
+</p>
+
+
+<h3 id="libs">Libraries</h3>
+
+<p>
+Every application is linked against the default Android library, which
+includes the basic packages for building applications (with common classes
+such as Activity, Service, Intent, View, Button, Application, ContentProvider,
+and so on).
+</p>
+
+<p>
+However, some packages reside in their own libraries. If your application
+uses code from any of these packages, it must explicitly asked to be linked
+against them. The manifest must contain a separate
+{@code <a href="#usesl">&lt;uses-library&gt;</a>} element to name each
+of the libraries. (The library name can be found in the documentation
+for the package.)
+</p>
+
+
+<h2 id="elems">Elements of the Manifest File</h2>
+
+<p>
+This section describes all the elements that can appear in the manifest and each
+of their attributes in more detail. Only the elements listed here are legal.
+The list is alphabetical.
+</p>
+
+
+<h3 id="actn">&lt;action&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;action android:name="<i>string</i>" /&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#ifilt">&lt;intent-filter&gt;</a>}</dd>
+
+<p>
+<dt>description:</dt>
+<dd>Adds an action to an intent filter.
+An {@code <a href="#ifilt">&lt;intent-filter&gt;</a>} element must contain
+one or more {@code &lt;action&gt;} 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
+Intent Filters</a> for details on intent filters and the role of action
+specifications within a filter.
+</dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:name}</dt>
+<dd>The name of the action. Some standard actions are defined in the
+{@link android.content.Intent#ACTION_CHOOSER Intent} class as
+{@code ACTION_<i>string</i>} constants. To assign one of these actions to
+this attribute, prepend "{@code android.intent.action.}" to the
+{@code <i>string</i>} that follows {@code ACTION_}.
+For example, for {@code ACTION_MAIN}, use "{@code android.intent.action.MAIN}"
+and for {@code ACTION_WEB_SEARCH}, use "{@code android.intent.action.WEB_SEARCH}".
+
+<p>
+For actions you define, it's best to use the package name as a prefix to
+ensure uniqueness. For example, a {@code TRANSMOGRIFY} action might be specified
+as follows:
+</p>
+
+<pre>&lt;action android:name="com.example.project.TRANSMOGRIFY" /&gt;</pre>
+</dd>
+</dl></dd>
+
+<dt>see also:</dt>
+<dd>{@code <a href="#ifilt">&lt;intent-filter&gt;</a>}</dd>
+
+</dl>
+<hr>
+
+<h3 id="actv">&lt;activity&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;activity android:allowTaskReparenting=["true" | "false"]
+ android:alwaysRetainTaskState=["true" | "false"]
+ android:clearTaskOnLaunch=["true"" | "false"]
+ android:configChanges=["mcc" | "mnc" | "locale" |
+ "touchscreen" | "keyboard" |
+ "keyboardHidden" | "navigation" |
+ "orientation" | "fontScale"]
+ android:enabled=["true" | "false"]
+ android:excludeFromRecents=["true" | "false"]
+ android:exported=["true" | "false"]
+ android:finishOnTaskLaunch=["true" | "false"]
+ android:icon="<i>drawable resource</i>"
+ android:label="<i>string resource</i>"
+ android:launchMode=["multiple" | "singleTop" |
+ "singleTask" | "singleInstance"]
+ android:multiprocess=["true" | "false"]
+ android:name="<i>string</i>"
+ android:permission="<i>string</i>"
+ android:process="<i>string</i>"
+ android:screenOrientation=["unspecified" | "user" | "behind" |
+ "landscape" | "portrait" |
+ "sensor" | "nonsensor"]
+ android:stateNotNeeded=["true" | "false"]
+ android:taskAffinity="<i>string</i>"
+ android:theme="<i>resource or theme</i>" &gt;
+ . . .
+&lt;/activity&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#app">&lt;application&gt;</a>}</dd>
+
+<dt>can contain:</dt>
+<dd>{@code <a href="#ifilt">&lt;intent-filter&gt;</a>}
+<br/>{@code <a href="#meta">&lt;meta-data&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Declares an activity (an {@link android.app.Activity} subclass) that
+implements part of the application's visual user interface. All activities
+must be represented by {@code &lt;activity&gt;}
+elements in the manifest file. Any that are not declared there will not be seen
+by the system and will never be run.
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt><a href name="actv_reparent"></a>{@code android:allowTaskReparenting}</dt>
+<dd>Whether or not the activity can move from the task that started it to
+the task it has an affinity for when that task is next brought to the
+front &mdash; "{@code true}" if it can move, and "{@code false}" if it
+must remain with the task where it started.
+
+<p>
+If this attribute is not set, the value set by the corresponding
+{@code <a href="#app_reparent">allowTaskReparenting</a>}
+attribute of the {@code <a href="#app">&lt;application&gt;</a>} element
+applies to the activity. The default value is "{@code false}".
+</p>
+
+<p>
+Normally when an activity is started, it's associated with the task of
+the activity that started it and it stays there for its entire lifetime.
+You can use this attribute to force it to be re-parented to the task it
+has an affinity for when its current task is no longer displayed.
+Typically, it's used to cause the activities of an application to move
+to the main task associated with that application.
+</p>
+
+<p>
+For example, if an e-mail message contains a link to a web page, clicking
+the link brings up an activity that can display the page. That activity
+is defined by the browser application, but is launched as part of the e-mail
+task. If it's reparented to the browser task, it will be shown when the
+browser next comes to the front, and will be absent when the e-mail task
+again comes forward.
+</p>
+
+<p>
+The affinity of an activity is defined by the
+{@code <a href="#actv_aff">taskAffinity</a>} attribute. The affinity
+of a task is determined by reading the affinity of its root activity.
+Therefore, by definition, a root activity is always in a task with the
+same affinity. Since activities with "{@code singleTask}" or
+"{@code singleInstance}" launch modes can only be at the root of a task,
+re-parenting is limited to the "{@code standard}" and "{@code singleTop}"
+modes. (See also the {@code <a href="#actv_lmode">launchMode</a>}
+attribute.)
+</p></dd>
+
+<dt>{@code android:alwaysRetainTaskState}</dt>
+<dd>Whether or not the state of the task that the activity is in will always
+be maintained by the system &mdash; "{@code true}" if it will be, and
+"{@code false}" if the system is allowed to reset the task to its initial
+state in certain situations. The default value is "{@code false}". This
+attribute is meaningful only for the root activity of a task; it's ignored
+for all other activities.
+
+<p>
+Normally, the system clears a task (removes all activities from the stack
+above the root activity) in certain situations when the user re-selects that
+task from the home screen. Typically, this is done if the user hasn't visited
+the task for a certain amount of time, such as 30 minutes.
+</p>
+
+<p>
+However, when this attribute is "{@code true}", users will always return
+to the task in its last state, regardless of how they get there. This is
+useful, for example, in an application like the web browser where there is
+a lot of state (such as multiple open tabs) that users would not like to lose.
+</p></dd>
+
+<dt>{@code android:clearTaskOnLaunch}</dt>
+<dd>Whether or not all activities will be removed from the task, except for
+the root activity, whenever it is re-launched from the home screen &mdash;
+"{@code true}" if the task is always stripped down to its root activity, and
+"{@code false}" if not. The default value is "{@code false}". This attribute
+is meaningful only for activities that start a new task (the root activity);
+it's ignored for all other activities in the task.
+
+<p>
+When the value is "{@code true}", every time users start the task again, they
+are brought to its root activity, regardless of what they were last doing in
+the task and regardless of whether they used BACK or HOME to last leave it.
+When the value is "{@code false}", the task may be cleared of activities in
+some situations (see the {@code alwaysRetainTaskState} attribute), but not always.
+</p>
+
+<p>
+Suppose, for example, that someone launches activity P from the home screen,
+and from there goes to activity Q. The user next presses HOME, and then returns
+to activity P. Normally, the user would see activity Q, since that is what they
+were last doing in P's task. However, if P set this flag to "{@code true}", all
+of the activities on top of it (Q in this case) were removed when the user pressed
+HOME and the task went to the background. So the user sees only P when returning
+to the task.
+</p>
+
+<p>
+If this attribute and {@code allowTaskReparenting} are both "{@code true}",
+any activities that can be re-parented are moved to the task they share an
+affinity with; the remaining activities are then dropped, as described above.
+</p></dd>
+
+<dt>{@code android:configChanges}</dt>
+<dd>Lists configuration changes that the activity will handle itself. When
+changes that are not listed occur, the activity is shut down and restarted.
+When a listed change occurs, the activity remains running and its <code>{@link android.app.Activity#onConfigurationChanged onConfigurationChanged()}</code>
+method is called.
+
+<p>
+Any or all of the following strings can be used to set this attribute. Values are
+separated by '{@code |}' &mdash; for example, "{@code locale|navigation|orientation}".
+</p>
+
+<table>
+<tr>
+ <td><b>Value</b></td>
+ <td><b>Description</b></td>
+</tr><tr>
+ <td>"{@code mcc}"</td>
+ <td>The IMSI mobile country code (MCC) has changed &mdash;
+ that is, a SIM has been detected and updated the MCC.</td>
+</tr><tr>
+ <td>"{@code mnc}"</td>
+ <td>The IMSI mobile network code (MNC) has changed &mdash;
+ that is, a SIM has been detected and updated the MNC.</td>
+</tr><tr>
+ <td>"{@code locale}"</td>
+ <td>The locale has changed &mdash; for example, the user has selected a new
+ language that text should be displayed in.</td>
+</tr><tr>
+ <td>"{@code touchscreen}"</td>
+ <td>The touchscreen has changed. (This should never normally happen.)</td>
+</tr><tr>
+ <td>"{@code keyboard}"</td>
+ <td>The keyboard type has changed &mdash; for example, the user has
+ plugged in an external keyboard.</td>
+</tr><tr>
+ <td>"{@code keyboardHidden}"</td>
+ <td>The keyboard accessibility has changed &mdash; for example, the
+ user has slid the keyboard out to expose it.</td>
+</tr><tr>
+ <td>"{@code navigation}"</td>
+ <td>The navigation type has changed. (This should never normally happen.)</td>
+</tr><tr>
+ <td>"{@code orientation}"</td>
+ <td>The screen orientation has changed &mdash; that is, the user has rotated
+ the device.</td>
+ </tr><tr>
+ <td>"{@code fontScale}"</td>
+ <td>The font scaling factor has changed &mdash; that is, the user has selected
+ a new global font size.</td>
+</tr>
+</table>
+
+<p>
+All of these configuration changes can impact the resource values seen by the
+application. Therefore, when <code>{@link android.app.Activity#onConfigurationChanged
+onConfigurationChanged()}</code> is called, it will generally be necessary to again
+retrieve all resources (including view layouts, drawables, and so on) to correctly
+handle the change.
+</p></dd>
+
+<dt>{@code android:enabled}</dt>
+<dd>Whether or not the activity can be instantiated by the system &mdash;
+"{@code true}" if it can be, and "{@code false}" if not. The default value
+is "{@code true}".
+
+<p>
+The {@code <a href="#app">&lt;application&gt;</a>} element has its own
+{@code <a href="#app_enabled">enabled</a>} attribute that applies to all
+application components, including activities. The
+{@code <a href="#app">&lt;application&gt;</a>} and {@code &lt;activity&gt;}
+attributes must both be "{@code true}" (as they both are by default) for
+the system to be able to instantiate the activity. If either is
+"{@code false}", it cannot be instantiated.
+</p></dd>
+
+<dt>{@code android:excludeFromRecents}</dt>
+<dd>Whether or not the activity should be excluded from the list of recently
+launched activities that can be displayed to users &mdash; "{@code true}" if
+it should be excluded, and "{@code false}" if it should be included.
+The default value is "{@code false}".
+</p></dd>
+
+<dt>{@code android:exported}</dt>
+<dd>Whether or not the activity can be launched by components of other
+applications &mdash; "{@code true}" if it can be, and "{@code false}" if not.
+If "{@code false}", the activity can be launched only by components of the
+same application or applications with the same user ID.
+
+<p>
+The default value depends on whether the activity contains intent filters. The
+absence of any filters means that the activity can be invoked only by specifying
+its exact class name. This implies that the activity is intended only for
+application-internal use (since others would not know the class name). So in
+this case, the default value is "{@code false}".
+On the other hand, the presence of at least one filter implies that the activity
+is intended for external use, so the default value is "{@code true}".
+</p>
+
+<p>
+This attribute is not the only way to limit an activity's exposure to other
+applications. You can also use a permission to limit the external entities that
+can invoke the activity (see the {@code <a href="#actv_prmsn">permission</a>}
+attribute).
+</p></dd>
+
+<dt>{@code android:finishOnTaskLaunch}</dt>
+<dd>Whether or not an existing instance of the activity should be shut down
+(finished) whenever the user again launches its task (chooses the task on the
+home screen) &mdash; "{@code true}" if it should be shut down, and "{@code false}"
+if not. The default value is "{@code false}".
+
+<p>
+If this attribute and {@code <a href="#actv_reparent">allowTaskReparenting</a>}
+are both "{@code true}", this attribute trumps the other. The affinity of the
+activity is ignored. The activity is not re-parented, but destroyed.
+</p>
+
+<dt><a name="actv_icon"></a>{@code android:icon}</dt>
+<dd>An icon representing the activity. The icon is displayed to users when
+a representation of the activity is required on-screen. For example, icons
+for activities that initiate tasks are displayed in the launcher window.
+The icon is often accompanied by a label (see the {@code label} attribute).
+</p>
+
+<p>
+This attribute must be set as a reference to a drawable resource containing
+the image definition. If it is not set, the icon specified for the application
+as a whole is used instead (see the {@code <a href="#app">&lt;application&gt;</a>}
+element's {@code <a href="#app_icon">icon</a>} attribute).
+</p>
+
+<p>
+The activity's icon &mdash; whether set here or by the
+{@code <a href="#app">&lt;application&gt;</a>} element &mdash; is also the
+default icon for all the activity's intent filters (see the
+{@code <a href="#ifilt">&lt;intent-filter&gt;</a>} element's
+{@code <a href="#ifilt_icon">icon</a>} attribute).
+</p></dd>
+
+<dt>{@code android:label}</dt>
+<dd>A user-readable label for the activity. The label is displayed on-screen
+when the activity must be represented to the user. It's often displayed along
+with the activity icon.
+
+<p>
+If this attribute is not set, the label set for the application as a whole is
+used instead (see the {@code <a href="#app">&lt;application&gt;</a>} element's
+{@code <a href="#app_label">label</a>} attribute).
+</p>
+
+<p>
+The activity's label &mdash; whether set here or by the
+{@code <a href="#app">&lt;application&gt;</a>} element &mdash; is also the
+default label for all the activity's intent filters (see the
+{@code <a href="#ifilt">&lt;intent-filter&gt;</a>} element's
+{@code <a href="#ifilt_label">label</a>} attribute).
+</p>
+
+<p>
+The label should be set as a reference to a string resource, so that
+it can be localized like other strings in the user interface.
+However, as a convenience while you're developing the application,
+it can also be set as a raw string.
+</p></dd>
+
+<dt><a name="actv_lmode"></a>{@code android:launchMode}</dt>
+<dd>An instruction on how the activity should be launched. There are four modes
+that work in conjunction with activity flags ({@code FLAG_ACTIVITY_*} constants)
+in {@link android.content.Intent} objects to determine what should happen when
+the activity is called upon to handle an intent:
+
+<p style="margin-left: 2em">"{@code standard}"
+<br>"{@code singleTop}"
+<br>"{@code singleTask}"
+<br>"{@code singleInstance}"</p>
+
+<p>
+The default mode is "{@code standard}".
+The modes differ from each other on three points:
+</p>
+
+<ol>
+
+<li><p><b>Whether or not a new instance of the class will be launched</b>. For
+the default "{@code standard}" mode, every time a new intent is received, a new
+instance of the class is created to handle that intent. For all the other modes,
+an existing instance is re-used if it resides at the top of the activity stack.
+As we'll see below, if there's an existing instance of a "{@code singleTask}" or
+"{@code singleInstance}" activity, it will always be (or come to be) at the top
+of the stack, so this condition will always be met for those two modes. However,
+an existing "{@code singleTop}" instance may or may not be at the top of the stack.
+If it is, it will be re-used. If not, a new instance is created.</p>
+
+<p>
+For example, suppose a task's activity stack consists of root activity A with
+activities B, C, and D on top in that order, so the stack is A-B-C-D. 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 is
+expected to handle the new intent (since it's at the top of the stack) and the
+stack remains A-B-C-D.
+</p>
+
+<p>
+If, on the other hand, the arriving intent is for an activity of type B, a new
+instance of B would be launched no matter whether B's mode is "{@code standard}"
+or "{@code singleTop}" (since B is not at the top of the stack), so the resulting
+stack would be A-B-C-D-B.
+</p>
+
+<p>
+Now, suppose again that the stack is A-B-C-D and that the intent that arrives for
+B has the <code>{@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}</code> flag set. Since
+the intent is destined for an activity of type B and the stack already has an object
+of that type, the flag causes activities C and D to be shut down and removed from
+the stack. If B's launch mode is "{@code standard}", it too will be removed, and
+a new instance of B launched 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}".
+However, if B's launch mode is "{@code singleTop}", the current instance would remain
+in the stack and receive the intent.
+</p>
+
+<p>
+Whenever an existing "{@code singleTop}", "{@code singleTask}", or
+"{@code singleInstance}" object is expected to handle an incoming intent, its
+<code>{@link android.app.Activity#onNewIntent onNewIntent()}</code> method is called with the
+{@link android.content.Intent} object passed as an argument.
+</p>
+</li>
+
+<li><p><b>Which task will hold the activity that responds to the intent</b>.
+For the "{@code standard}" and "{@code singleTop}" modes, it's the task that
+originated the intent (and called <code>{@link android.content.Context#startActivity
+startActivity()}</code>) &mdash; unless the Intent object contains the
+<code>{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK}</code> flag. In that case,
+a different task is chosen as follows:</p>
<ul>
-<li> <p>Almost every AndroidManifest.xml (as well as many other Android
-XML files) will include the namespace declaration
-<code>xmlns:android="http://schemas.android.com/apk/res/android"</code> in
-its first element. This makes a variety of standard Android attributes
-available in the file, which will be used to supply most of the data for
-elements in that file.</code>
-<li> <p>Most manifests include a single <code>&lt;application&gt;</code>
-element, which defines all of the application-level components and
-properties that are available in the package.</p>
-<li> <p>Any package that will be presented to the user as a top-level
-application available from the program launcher will need to include at
-least one {@link android.app.Activity} component that supports the
-{@link android.content.Intent#ACTION_MAIN MAIN} action and
-{@link android.content.Intent#CATEGORY_LAUNCHER LAUNCHER} category as
-shown here.</p>
+<li>If there's an existing task with the same affinity as the target activity,
+that task will hold the instance that responds to the intent. (As noted above,
+it could be an existing instance for a "{@code singleTop}" activity, but will
+always be a new instance for a "{@code standard}" activity.)</li>
+
+<li>Otherwise, the activity is launched as the root of a new task.</li>
</ul>
-<p>Here is a detailed outline of the structure of an AndroidManifest.xml file,
-describing all tags that are available.</p>
+<p>
+In contrast, the "{@code singleTask}" and "{@code singleInstance}" modes mark
+activities that will always be at the root of a task; they can never be launched
+as part of another task. Moreover, once a "{@code singleTask}" or
+"{@code singleInstance}" activity has been launched, that instance is re-used
+to handle all new intents, so there is never more than one instance of the
+activity on the device.
+</p>
+
+<p>
+When a new intent arrives for an existing "{@code singleTask}" activity, all
+other activities are removed from its stack, so that only the root activity
+remains; it's as if the Intent object included the
+<code>{@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}</code> flag. The activity
+is then at the top of its stack, and in a position to receive the new intent
+in an <code>{@link android.app.Activity#onNewIntent onNewIntent()}</code> call.
+</p></li>
+
+<li><p><b>Whether the instance can have other activities in its task</b>.
+A "{@code singleInstance}" activity stands alone as the only activity in its
+task. If it starts another activity, that activity will be launched in a
+different task regardless of its launch mode. In all other respects, the
+"{@code singleInstance}" mode is identical to "{@code singleTask}".</p>
+
+<p>
+All modes other than "{@code singleInstance}" permit multiple activities
+to belong to the task.
+</p></li>
+</ol>
+</dd>
+
+<dt>{@code android:multiprocess}</dt>
+<dd>Whether an instance of the activity can be launched into the process of the component
+that started it &mdash; "{@code true}" if it can be, and "{@code false}" if not.
+The default value is "{@code false}".
+
+<p>
+Normally, a new instance of an activity is launched into the process of the
+application that defined it, so all instances of the activity run in the same
+process. However, if this flag is set to "{@code true}", instances of the
+activity can run in multiple processes, allowing the system to create instances
+wherever they are used (provided permissions allow it), something that is almost
+never necessary or desirable.
+</p></dd>
+
+<dt>{@code android:name}</dt>
+<dd>The name of the class that implements the activity, a subclass of
+{@link android.app.Activity}. The attribute value should be a fully qualified
+class name (such as, "{@code com.example.project. ExtracurricularActivity}").
+However, as a shorthand, if the first character of the name is a period
+(for example, "{@code . ExtracurricularActivity}"), it is appended to the
+package name specified in the {@code <a href="#manf">&lt;manifest&gt;</a>}
+element.
+
+<p>
+There is no default. The name must be specified.
+</p></dd>
+
+<dt><a name="actv_prmsn"></a>{@code android:permission}</dt>
+<dd>The name of a permission that clients must have to launch the activity
+or otherwise get it to respond to an intent. If a caller of
+<code>{@link android.content.Context#startActivity startActivity()}</code> or
+<code>{@link android.app.Activity#startActivityForResult startActivityForResult()}</code>
+has not been granted the specified permission, its intent will not be
+delivered to the activity.
+
+<p>
+If this attribute is not set, the permission set by the
+{@code <a href="#app">&lt;application&gt;</a>} element's
+{@code <a href="#app_prmsn">permission</a>} attribute applies
+to the activity. If neither attribute is set, the activity is
+not protected by a permission.
+</p>
+
+<p>
+For more information on permissions, see the <a href="#sectperm">Permissions</a>
+section earlier in this document and a separate document,
+<a href="{@docRoot}guide/topics/security/security.html">Security and
+Permissions</a>.
+</p></dd>
+
+<dt>{@code android:process}</dt>
+<dd>The name of the process in which the activity should run. Normally,
+all components of an application run in the default process created for the
+application. It has the same name as the application package. The {@code <a href="#app">&lt;application&gt;</a>} element's
+{@code <a href="#app_proc">process</a>} attribute can set a different
+default for all components. But each component can override the default,
+allowing you to spread your application across multiple processes.
+
+<p>
+If the name assigned to this attribute begins with a colon (':'), a new
+process, private to the application, is created when it's needed and
+the activity runs in that process.
+If the process name begins with a lowercase character, the activity will run
+in a global process of that name, provided that it has permission to do so.
+This allows components in different applications to share a process, reducing
+resource usage.
+</p></dd>
+
+<dt>{@code android:screenOrientation}</dt>
+<dd>The orientation of the activity's display on the device.
+The value can be any one of the following strings:
+
+<table>
+<tr>
+ <td>"{@code unspecified}"</td>
+ <td>The default value. The system chooses the orientation. The policy it
+ uses, and therefore the choices made in specific contexts, may differ
+ from device to device.</td>
+</tr><tr>
+ <td>"{@code landscape}"</td>
+ <td>Landscape orientation (the display is wider than it is tall).</td>
+</tr><tr>
+ <td>"{@code portrait}"</td>
+ <td>Portrait orientation (the display is taller than it is wide).</td>
+</tr><tr>
+ <td>"{@code user}"</td>
+ <td>The user's current preferred orientation.</td>
+</tr><tr>
+ <td>"{@code behind}"</td>
+ <td>The same orientation as the activity that's immediately beneath it in
+ the activity stack.</td>
+</tr><tr>
+ <td>"{@code sensor}"</td>
+ <td>The orientation determined by a physical orientation sensor. The
+ orientation of the display depends on how the user is holding the device;
+ it changes when the user rotates the device.</td>
+</tr><tr>
+ <td>"{@code nosensor}"</td>
+ <td>An orientation determined without reference to a physical orientation sensor.
+ The sensor is ignored, so the display will not rotate based on how the user
+ moves the device. Except for this distinction, the system chooses the
+ orientation using the same policy as for the "{@code unspecified}" setting.</td>
+</tr>
+</table></dd>
+
+<dt>{@code android:stateNotNeeded}</dt>
+<dd>Whether or not the activity can be killed and successfully restarted
+without having saved its state &mdash; "{@code true}" if it can be restarted
+without reference to its previous state, and "{@code false}" if its previous
+state is required. The default value is "{@code false}".
+
+<p>
+Normally, before an activity is temporarily shut down to save resources, its
+<code>{@link android.app.Activity#onSaveInstanceState onSaveInstanceState()}</code>
+method is called. This method stores the current state of the activity in a
+{@link android.os.Bundle} object, which is then passed to
+<code>{@link android.app.Activity#onCreate onCreate()}</code> when the activity
+is restarted. If this attribute is set to "{@code true}",
+{@code onSaveInstanceState()} may not be called and {@code onCreate()} will
+be passed {@code null} instead of the Bundle &mdash; just as it was when the
+activity started for the first time.
+</p>
+
+<p>
+A "{@code true}" setting ensures that the activity can be restarted in the
+absence of retained state. For example, the activity that displays the
+home screen uses this setting to make sure that it does not get removed if it
+crashes for some reason.
+</p></dd>
+
+<dt><a name="actv_aff"></a>{@code android:taskAffinity}</dt>
+<dd>The task that the activity has an affinity for. Activities with
+the same affinity conceptually belong to the same task (to the same
+"application" from the user's perspective). The affinity of a task
+is determined by the affinity of its root activity.
+
+<p>
+The affinity determines two things &mdash; the task that the activity is re-parented
+to (see the {@code <a href="#actv_reparent">allowTaskReparenting</a>}
+attribute) and the task that will house the activity when it is launched
+with the <code>{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK}</code>
+flag.
+</p>
+
+<p>
+By default, all activities in an application have the same affinity. You
+can set this attribute to group them differently, and even place
+activities defined in different applications within the same task. To
+specify that the activity does not have an affinity for any task, set
+it to an empty string.
+
+<p>
+If this attribute is not set, the activity inherits the affinity set
+for the application (see the {@code <a href="#app">&lt;application&gt;</a>}
+element's {@code <a href="#app_aff">taskAffinity</a>} attribute).
+The name of the default affinity for an application is the package name set
+by the {@code <a href="#manf">&lt;manifest&gt;</a>} element.
+</p>
+
+<dt><a name="actv_theme"></a>{@code android:theme}</dt>
+<dd>A reference to a style resource defining an overall theme for the activity.
+This automatically sets the activity's context to use this theme (see
+<code>{@link android.content.Context#setTheme setTheme()}</code>, and may also
+cause "starting" animations prior to the activity being launched (to better
+match what the activity actually looks like).
+
+<p>
+If this attribute is not set, the activity inherits the theme set for the
+application as a whole &mdash; see the {@code <a href="#app">&lt;application&gt;</a>}
+element's {@code <a href="#app_theme">theme</a>} attribute. If that attribute is
+also not set, the default system theme is used.
+</p>
+<dd>
+</dl></dd>
+
+</dl>
+<hr>
+
+
+<h3 id="alias">&lt;activity-alias&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;activity-alias android:enabled=["true" | "false"]
+ android:exported=["true" | "false"]
+ android:icon="<i>drawable resource</i>"
+ android:label="<i>string resource</i>"
+ android:name="<i>string</i>"
+ android:permission="<i>string</i>"
+ android:targetActivity="<i>string</i>" &gt;
+ . . .
+&lt;/activity-alias&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#app">&lt;application&gt;</a>}</dd>
+
+<dt>can contain:</dt>
+<dd>{@code <a href="#ifilt">&lt;intent-filter&gt;</a>}
+<br/>{@code <a href="#meta">&lt;meta-data&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>An alias for an activity, named by the {@code targetActivity}
+attribute. The target must be in the same application as the
+alias and it must be declared before the alias in the manifest.
+
+<p>
+The alias presents the target activity as a independent entity.
+It can have its own set of intent filters, and they, rather than the
+intent filters on the target activity itself, determine which intents
+can activate the target through the alias and how the system
+treats the alias. For example, the intent filters on the alias may
+specify the "<code>{@link android.content.Intent#ACTION_MAIN
+android.intent.action.MAIN}</code>"
+and "<code>{@link android.content.Intent#CATEGORY_LAUNCHER
+android.intent.category.LAUNCHER}</code>" flags, causing it to be
+represented in the application launcher, even though none of the
+filters on the target activity itself set these flags.
+</p>
+
+<p>
+With the exception of {@code targetActivity}, {@code &lt;activity-alias&gt;}
+attributes are a subset of {@code <a href="#actv">&lt;activity&gt;</a>} attributes.
+For attributes in the subset, none of the values set for the target carry over
+to the alias. However, for attributes not in the subset, the values set for
+the target activity also apply to the alias.
+</p></dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:enabled}</dt>
+<dd>Whether or not the target activity can be instantiated by the system through
+this alias &mdash; "{@code true}" if it can be, and "{@code false}" if not.
+The default value is "{@code true}".
+
+<p>
+The {@code <a href="#app">&lt;application&gt;</a>} element has its own
+{@code <a href="#app_enabled">enabled</a>} attribute that applies to all
+application components, including activity aliases. The
+{@code <a href="#app">&lt;application&gt;</a>} and {@code &lt;activity-alias&gt;}
+attributes must both be "{@code true}" for the system to be able to instantiate
+the target activity through the alias. If either is "{@code false}", the alias
+does not work.
+</p></dd>
+
+<dt>{@code android:exported}</dt>
+<dd>Whether or not components of other applications can launch the target activity
+through this alias &mdash; "{@code true}" if they can, and "{@code false}" if not.
+If "{@code false}", the target activity can be launched through the alias only by
+components of the same application as the alias or applications with the same user ID.
+
+<p>
+The default value depends on whether the alias contains intent filters. The
+absence of any filters means that the activity can be invoked through the alias
+only by specifying the exact name of the alias. This implies that the alias
+is intended only for application-internal use (since others would not know its name)
+&mdash; so the default value is "{@code false}".
+On the other hand, the presence of at least one filter implies that the alias
+is intended for external use &mdash; so the default value is "{@code true}".
+</p></dd>
+
+<dt>{@code android:icon}</dt>
+<dd>An icon for the target activity when presented to users through the alias.
+See the {@code <a href="#actv">&lt;activity&gt;</a>} element's
+{@code <a href="#actv_icon">icon</a>} attribute for more information.
+
+<dt>{@code android:label}</dt>
+<dd>A user-readable label for the alias when presented to users through the alias.
+See the the {@code <a href="#actv">&lt;activity&gt;</a>} element's
+{@code <a href="#actv_label">label</a>} attribute for more information.
+</p></dd>
+
+<dt>{@code android:name}</dt>
+<dd>A unique name for the alias. The name should resemble a fully
+qualified class name. But, unlike the name of the target activity,
+the alias name is arbitrary; it does not refer to an actual class.
+</p></dd>
+
+<dt>{@code android:permission}</dt>
+<dd>The name of a permission that clients must have to launch the target activity
+or get it to do something via the alias. If a caller of
+<code>{@link android.content.Context#startActivity startActivity()}</code> or
+<code>{@link android.app.Activity#startActivityForResult startActivityForResult()}</code>
+has not been granted the specified permission, the target activity will not be
+activated.
+
+<p>This attribute supplants any permission set for the target activity itself. If
+it is not set, a permission is not needed to activate the target through the alias.
+</p>
+
+<p>
+For more information on permissions, see the {@code <a href="#perms">Permissions</a>
+section earlier in this document.
+</p></dd>
+
+<dt>{@code android:targetActivity}</dt>
+<dd>The name of the activity that can be activated through the alias.
+This name must match the {@code name} attribute of an
+{@code <a href="#actv">&lt;activity&gt;</a>} element that precedes
+the alias in the manifest.
+</p></dd>
+</dl></dd>
+
+<dt>see also:</dt>
+<dd>{@code <a href="#actv">&lt;activity&gt;</a>}</dd>
+
+</dl>
+<hr>
+
+<h3 id="app">&lt;application&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;application android:allowClearUserData=["true" | "false"]
+ android:allowTaskReparenting=["true" | "false"]
+ android:debuggable=["true" | "false"]
+ android:description="<i>string resource</i>"
+ android:enabled=["true" | "false"]
+ android:hasCode=["true" | "false"]
+ android:icon="<i>drawable resource</i>"
+ android:label="<i>string resource</i>"
+ android:manageSpaceActivity="<i>string</i>"
+ android:name="<i>string</i>"
+ android:permission="<i>string</i>"
+ android:persistent=["true" | "false"]
+ android:process="<i>string</i>"
+ android:taskAffinity="<i>string</i>"
+ android:theme="<i>resource or theme</i>" &gt;
+ . . .
+&lt;/application&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#manf">&lt;manifest&gt;</a>}</dd>
+
+<dt>can contain:</dt>
+<dd>{@code <a href="#actv">&lt;activity&gt;</a>}
+<br/>{@code <a href="#alias">&lt;activity-alias&gt;</a>}
+<br/>{@code <a href="#srvc">&lt;service&gt;</a>}
+<br/>{@code <a href="#rcvr">&lt;receiver&gt;</a>}
+<br/>{@code <a href="#pvdr">&lt;provider&gt;</a>}
+<br/>{@code <a href="#usesl">&lt;uses-library&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>The declaration of the application. This element contains subelements
+that declare each of the application's components and has attributes
+that can affect all the components. Many of these attributes (such as
+{@code icon}, {@code label}, {@code permission}, {@code process},
+{@code taskAffinity}, and {@code allowTaskReparenting}) set default values
+for corresponding attributes of the component elements. Others (such as
+{@code debuggable}, {@code enabled}, {@code description}, and
+{@code allowClearUserData}) set values for the application as a whole and
+cannot be overridden by the components.</dd>
+
+<dt>attributes</dt>
+<dd><dl class="attr">
+<dt>{@code android:allowClearUserData}</dt>
+<dd>Whether or not users are given the option to remove user data &mdash;
+"{@code true}" if they are, and "{@code false}" if not. If the value is
+"{@code true}", as it is by default, the application manager includes an
+option that allows users to clear the data.</dd>
+
+<dt><a name="app_reparent"></a>{@code android:allowTaskReparenting}</dt>
+<dd>Whether or not activities that the application defines can move from
+the task that started them to the task they have an affinity for when that task
+is next brought to the front &mdash; "{@code true}" if they can move, and
+"{@code false}" if they must remain with the task where they started.
+The default value is "{@code false}".
+
+<p>
+The {@code <a href="#actv">&lt;activity&gt;</a>} element has its own
+{@code <a href="#act_reparent">allowTaskReparenting</a>} attribute
+that can override the value set here. See that attribute for more
+information.
+</p></dd>
+
+<dt>{@code android:debuggable}</dt>
+<dd>Whether or not the application can be debugged, even when running
+on a device in user mode &mdash; "{@code true}" if it can be, and "{@code false}"
+if not. The default value is "{@code false}".</dd>
+
+<dt>{@code android:description}</dt>
+<dd>User-readable text about the application, longer and more descriptive than the application label. The value must be set as a reference to a string resource. Unlike the label, it cannot be a raw string. There is no default value.</dd>
+
+<dt><a name="app_enabled"></a>{@code android:enabled}</dt>
+<dd>Whether or not the Android system can instantiate components of
+the application &mdash; "{@code true}" if it can, and "{@code false}"
+if not. If the value is "{@code true}", each component's
+{@code enabled} attribute determines whether that component is enabled
+or not. If the value is "{@code false}", it overrides the
+component-specific values; all components are disabled.
+
+<p>
+The default value is "{@code true}".
+</p></dd>
+
+<dt>{@code android:hasCode}</dt>
+<dd>Whether or not the application contains any code &mdash; "{@code true}"
+if it does, and "{@code false}" if not. When the value is "{@code false}",
+the system does not try to load any application code when launching components.
+The default value is "{@code true}".
+
+<p>
+An application would not have any code of its own only if it's using nothing
+but built-in component classes, such as an activity that uses the {@link
+android.app.AliasActivity} class, a rare occurrence.
+
+<dt><a name="app_icon"></a>{@code android:icon}</dt>
+<dd>An icon for the application as whole, and the default icon for
+each of the application's components. See the individual
+{@code icon} attributes for
+{@code <a href="#actv">&lt;activity&gt;</a>},
+{@code <a href="#alias">&lt;activity-alias&gt;</a>},
+{@code <a href="#srvc">&lt;service&gt;</a>},
+{@code <a href="#rcvr">&lt;receiver&gt;</a>}, and
+{@code <a href="#pvdr">&lt;provider&gt;</a>} elements.
+
+<p>
+This attribute must be set as a reference to a drawable resource containing
+the image definition. There is no default icon.
+</p></dd>
+
+<dt><a name="app_label"></a>{@code android:label}</dt>
+<dd>A user-readable label for the application as a whole, and a default
+label for each of the application's components. See the individual
+{@code label} attributes for
+{@code <a href="#actv">&lt;activity&gt;</a>},
+{@code <a href="#alias">&lt;activity-alias&gt;</a>},
+{@code <a href="#srvc">&lt;service&gt;</a>},
+{@code <a href="#rcvr">&lt;receiver&gt;</a>}, and
+{@code <a href="#pvdr">&lt;provider&gt;</a>} elements.
+
+<p>
+The label should be set as a reference to a string resource, so that
+it can be localized like other strings in the user interface.
+However, as a convenience while you're developing the application,
+it can also be set as a raw string.
+</p></dd>
+
+<dt>{@code android:manageSpaceActivity}</dt>
+<dd>The fully qualified name of an Activity subclass that the system
+can launch to let users manage the memory occupied by the application
+on the device. The activity should also be declared with an
+{@code <a href="#actv">&lt;activity&gt;</a>} element.
+</dd>
+
+<dt>{@code android:name}</dt>
+<dd>The fully qualified name of an {@link android.app.Application}
+subclass implemented for the application. When the application process
+is started, this class is instantiated before any of the application's
+components.
+
+<p>
+The subclass is optional; most applications won't need one.
+In the absence of a subclass, Android uses an instance of the base
+Application class.
+</p></dd>
+
+<dt><a name="app_prmsn"></a>{@code android:permission}</dt>
+<dd>The name of a permission that clients must have in order to interact
+with the application. This attribute is a convenient way to set a
+permission that applies to all of the application's components. It can
+be overwritten by setting the {@code permission} attributes of individual
+components.
+
+<p>
+For more information on permissions, see the <a href="#sectperm">Permissions</a>
+section earlier in this document and a separate document,
+<a href="{@docRoot}guide/topics/security/security.html">Security and
+Permissions</a>.
+</p></dd>
+
+<dt>{@code android:persistent}</dt>
+<dd>Whether or not the application should remain running at all times &mdash;
+"{@code true}" if it should, and "{@code false}" if not. The default value
+is "{@code false}". Applications should not normally set this flag;
+persistence mode is intended only for certain system applications.</dd>
+
+<dt><a name="app_proc"></a>{@code android:process}</dt>
+<dd>The name of a process where all components of the application should run.
+Each component can override this default by setting its own {@code process}
+attribute.
+
+<p>
+By default, Android creates a process for an application when the first
+of its components needs to run. All components then run in that process.
+The name of the default process matches the package name set by the
+{@code <a href="#manf">&lt;manifest&gt;</a>} element.
+</p>
+
+<p>By setting this attribute to a process name that's shared with another
+application, you can arrange for components of both applications to run in
+the same process &mdash; but only if the two applications also share a
+user ID and be signed with the same certificate.
+</p>
+
+<p>
+If the name assigned to this attribute begins with a colon (':'), a new
+process, private to the application, is created when it's needed.
+If the process name begins with a lowercase character, a global process
+of that name is created. A global process can be shared with other
+applications, reducing resource usage.
+</p></dd>
+
+<dt><a href name="app_aff"></a>{@code android:taskAffinity}</dt>
+<dd>An affinity name that applies to all activities within the application,
+except for those that set a different affinity with their own {@code
+<a href="#actv_aff">taskAffinity</a>} attributes. See that attribute
+for more information.
+
+<p>
+By default, all activities within an application share the same
+affinity. The name of that affinity is the same as the package name
+set by the {@code <a href="#manf">&lt;manifest&gt;</a>} element.
+</p></dd>
+
+<dt><a name="app_theme"></a>{@code android:theme}</dt>
+<dd>A reference to a style resource defining a default theme for all
+activities in the application. Individual activities can override
+the default by setting their own {@code <a href="#actv_theme">theme</a>}
+attributes; see that attribute for more information.</dd>
+
+</dl></dd>
+
+<dt>see also:</dt>
+<dd>{@code <a href="#actv">&lt;activity&gt;</a>}
+<br/>{@code <a href="#srvc">&lt;service&gt;</a>}
+<br/>{@code <a href="#rcvr">&lt;receiver&gt;</a>}
+<br/>{@code <a href="#pvdr">&lt;provider&gt;</a>}</dd>
+
+</dl>
+<hr>
+
+<h3 id="catg">&lt;category&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;category android:name="<i>string</i>" /&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#ifilt">&lt;intent-filter&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Adds a category name to an intent filter. See
+<a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and
+Intent Filters</a> for details on intent filters and the role of category
+specifications within a filter.</dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:name}</dt>
+<dd>The name of the category. Standard categories are defined in the
+{@link android.content.Intent} class as {@code CATEGORY_<i>name</i>}
+constants. The name assigned here can be derived from those constants
+by prefixing "{@code android.intent.category.}" to the
+{@code <i>name</i>} that follows {@code CATEGORY_}. For example,
+the string value for {@code CATEGORY_LAUNCHER} is
+"{@code android.intent.category.LAUNCHER}".
+
+<p>
+Custom categories should use the package name as a prefix, to ensure
+that they are unique.
+</p></dd>
+</dl></dd>
+
+<dt>see also:</dt>
+<dd>{@code <a href="#actn">&lt;action&gt;</a>}
+<br/>{@code <a href="#data">&lt;data&gt;</a>}</dd>
+
+</dl>
+<hr>
+
+<h3 id="data">&lt;data&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;data android:host="<i>string</i>"
+ android:mimeType="<i>string</i>"
+ android:path="<i>string</i>"
+ android:pathPattern="<i>string</i>"
+ android:pathPrefix="<i>string</i>"
+ android:port="<i>string</i>"
+ android:scheme="<i>string</i>" /&gt;</pre></dd>
+
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#ifilt">&lt;intent-filter&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Adds a data specification to an intent filter. The specification can
+be just a data type (the {@code <a href="#data_mime">mimeType</a>} attribute),
+just a URI, or both a data type and a URI. A URI is specified by separate
+attributes for each of its parts:
+
+<p style="margin-left: 2em">{@code scheme://host:port/path} <i>or</i>
+{@code pathPrefix} <i>or</i> {@code pathPattern}</p>
+
+<p>
+These attributes are optional, but also mutually dependent:
+If a {@code <a href="#data_scheme">scheme</a>} is not specified for the
+intent filter, all the other URI attributes are ignored. If a
+{@code <a href="#data_host">host</a>} is not specified for the filer,
+the {@code port} attribute and all the path attributes are ignored.
+</p>
+
+<p>
+All the {@code &lt;data&gt;} elements contained within the same
+{@code <a href="#ifilt">&lt;intent-filter&gt;</a>} element contribute to
+the same filter. So, for example, the following filter specification,
+</p>
+
+<pre>&lt;intent-filter . . . &gt;
+ &lt;data android:scheme="something" android:host="project.example.com" /&gt;
+ . . .
+&lt;/intent-filter&gt;</pre>
+
+<p>is equivalent to this one:</p>
+
+<pre>&lt;intent-filter . . . &gt;
+ &lt;data android:scheme="something" /&gt
+ &lt;data android:host="project.example.com" /&gt;
+ . . .
+&lt;/intent-filter&gt;</pre>
+
+<p>
+You can place any number of &lt;data&gt; elements inside an
+{@code <a href="#ifilt">&lt;intent-filter&gt;</a>} to give it multiple data
+options. None of its attributes have default values.
+</p>
+
+<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
+Intent Filters</a>. See also the <a href="#ifs">Intent Filters</a> section
+earlier in this document.
+</p></dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt><a name="data_host"></a>{@code android:host}</dt>
+<dd>The host part of a URI authority. This attribute is meaningless
+unless a {@code <a href="#data_scheme">scheme</a>} attribute is also
+specified for the filter.
+</dd>
+
+<dt><a name="data_mime"></a>{@code android:mimeType}</dt>
+<dd>A MIME media type, such as {@code image/jpeg} or {@code audio/mpeg4-generic}.
+The subtype can be the asterisk wildcard ({@code *}) to indicate that any
+subtype matches.</dd>
+
+<dt>{@code android:path}
+<br/>{@code android:pathPrefix}
+<br/>{@code android:pathPattern}</dt>
+<dd>The path part of a URI. The {@code path} attribute specifies a complete
+path that is matched against the complete path in an Intent object. The
+{@code pathPrefix} attribute specifies a partial path that is matched against
+only the initial part of the path in the Intent object. The {@code pathPattern}
+attribute specifies a complete path that is matched against the complete path
+in the Intent object, but it can contain the following wildcards:
+
+<ul>
+<li>An asterisk ('{@code *}') matches a sequence of 0 to many occurrences of
+the immediately preceding character.</li>
+
+<li><p>A period followed by an asterisk ("{@code .*}") matches any sequence of
+0 to many characters.</p></li>
+</ul>
+
+<p>
+Because '{@code \}' is used as an escape character when the string is read
+from XML (before it is parsed as a pattern), you will need to double-escape:
+For example, a literal '{@code *}' would be written as "{@code \\*}" and a
+literal '{@code \}' would be written as "{@code \\\\}". This is basically
+the same as what you would need to write if constructing the string in Java code.
+</p>
+
+<p>
+For more information on these three types of patterns, see the descriptions of
+{@link android.os.PatternMatcher#PATTERN_LITERAL},
+{@link android.os.PatternMatcher#PATTERN_PREFIX}, and
+{@link android.os.PatternMatcher#PATTERN_SIMPLE_GLOB} in the
+{@link android.os.PatternMatcher} class.
+</p>
+
+<p>These attributes are meaningful only if the
+{@code <a href="#data_scheme">scheme</a>} and
+{@code <a href="#data_host">host</a>}
+attributes are also specified for the filter.
+</p></dd>
+
+<dt>{@code android:port}</dt>
+<dd>The port part of a URI authority. This attribute is meaningful only
+if the {@code <a href="#data_scheme">scheme</a>} and
+{@code <a href="#data_host">host</a>} attributes are also specified for
+the filter.</dd>
+
+<dt><a name="data_scheme"></a>{@code android:scheme}</dt>
+<dd>The scheme part of a URI. This is the minimal essential attribute for
+specifying a URI; at least one {@code scheme} attribute must be set
+for the filter, or none of the other URI attributes are meaningful.
+
+<p>
+A scheme is specified without the trailing colon (for example,
+{@code http}, rather than {@code http:}).
+</p>
+
+<p>
+If the filter has a data type set (the {@code <a href="#data_mime">mimeType</a>}
+attribute) but no scheme, the {@code content:} and {@code file:} schemes are
+assumed.
+</p></dd>
+</dl></dd>
+
+<dt>see also:</dt>
+<dd>{@code <a href="#actn">&lt;action&gt;</a>}
+<br/>{@code <a href="#catg">&lt;category&gt;</a>}</dd>
+
+</dl>
+<hr>
+
+<h3 id="grantp">&lt;grant-uri-permission&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;grant-uri-permission android:path="<i>string</i>"
+ android:pathPattern="<i>string</i>"
+ android:pathPrefix="<i>string</i>" /&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#pvdr">&lt;provider&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Specifies which data subsets of the parent content provider permission
+can be granted for. Data subsets are indicated by the path part of a
+{@code content:} URI. (The authority part of the URI identifies the
+content provider.)
+Granting permission is a way of enabling clients of the provider that don't
+normally have permission to access its data to overcome that restriction on
+a one-time basis.
+
+<p>
+If a content provider's {@code <a href="#pvdr_gprmsn">grantUriPermissions</a>}
+attribute is "{@code true}", permission can be granted for any the data under
+the provider's purview. However, if that attribute is "{@code false}", permission
+can be granted only to data subsets that are specified by this element.
+A provider can contain any number of {@code &lt;grant-uri-permission&gt;} elements.
+Each one can specify only one path (only one of the three possible attributes).
+</p>
+
+<p>
+For information on how permission is granted, see the
+{@code <a href="#ifilt">&lt;intent-filter&gt;</a>} element's
+{@code <a href="#pvdr_gprmsn">grantUriPermissions</a>} attribute.
+</p></dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:path}
+<br/>{@code android:pathPrefix}
+<br/>{@code android:pathPattern}</dt>
+<dd>A path identifying the data subset or subsets that permission can be
+granted for. The {@code path} attribute specifies a complete path;
+permission can be granted only to the particular data subset identified
+by that path.
+The {@code pathPrefix} attribute specifies the initial part of a path;
+permission can be granted to all data subsets with paths that share that
+initial part.
+The {@code pathPattern} attribute specifies a complete path, but one
+that can contain the following wildcards:
+
+<ul>
+<li>An asterisk ('{@code *}') matches a sequence of 0 to many occurrences of
+the immediately preceding character.</li>
+
+<li><p>A period followed by an asterisk ("{@code .*}") matches any sequence of
+0 to many characters.</p></li>
+</ul>
+
+<p>
+Because '{@code \}' is used as an escape character when the string is read
+from XML (before it is parsed as a pattern), you will need to double-escape:
+For example, a literal '{@code *}' would be written as "{@code \\*}" and a
+literal '{@code \}' would be written as "{@code \\\\}". This is basically
+the same as what you would need to write if constructing the string in Java code.
+</p>
+
+<p>
+For more information on these types of patterns, see the descriptions of
+{@link android.os.PatternMatcher#PATTERN_LITERAL},
+{@link android.os.PatternMatcher#PATTERN_PREFIX}, and
+{@link android.os.PatternMatcher#PATTERN_SIMPLE_GLOB} in the
+{@link android.os.PatternMatcher} class.
+</p></dd>
+</dl></dd>
+
+<dt>see also:</dt>
+<dd>the {@code <a href="#pvdr_gprmsn">grantUriPermissions</a>} attribute
+of the {@code <a href="#pvdr">&lt;provider&gt;</a>} element</dd>
+
+
+</dl>
+<hr>
+
+<h3 id="instru">&lt;instrumentation&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;instrumentation android:functionalTest=["true" | "false"]
+ android:handleProfiling=["true" | "false"]
+ android:icon="<i>drawable resource</i>"
+ android:label="<i>string resource</i>"
+ android:name="<i>string</i>"
+ android:targetPackage="<i>string</i>" /&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#manf">&lt;manifest&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Declares an {@link android.app.Instrumentation} class that enables you
+to monitor an application's interaction with the system. The Instrumentation
+object is instantiated before any of the application's components.</dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:functionalTest}</dt>
+<dd>Whether or not the Instrumentation class should run as a functional test
+&mdash; "{@code true}" if it should, and "{@code false}" if not. The
+default value is "{@code false}".</dd>
+
+<dt>{@code android:handleProfiling}</dt>
+<dd>Whether or not the Instrumentation object will turn profiling on and
+off &mdash; "{@code true}" if it determines when profiling starts and
+stops, and "{@code false}" if profiling continues the entire time it is
+running. A value of "{@code true}" enables the object to target profiling
+at a specific set of operations. The default value is "{@code false}".</dd>
+
+<dt>{@code android:icon}</dt>
+<dd>An icon that represents the Instrumentation class. This attribute must
+be set as a reference to a drawable resource.</dd>
+
+<dt>{@code android:label}</dt>
+<dd>A user-readable label for the Instrumentation class. The label can
+be set as a raw string or a reference to a string resource.</dd>
+
+<dt>{@code android:name}</dt>
+<dd>The name of the {@link android.app.Instrumentation} subclass.
+This should be a fully qualified class name (such as,
+"{@code com.example.project.StringInstrumentation}"). However, as a shorthand,
+if the first character of the name is a period, it is appended to the package
+name specified in the {@code <a href="#manf">&lt;manifest&gt;</a>} element.
+
+<p>
+There is no default. The name must be specified.
+</p></dd>
+
+<dt>{@code android:targetPackage}</dt>
+<dd>The application that the Instrumentation object will run against.
+An application is identified by the package name assigned in its manifest
+file by the {@code <a href="#manf">&lt;manifest&gt;</a>} element.</dd>
+
+</dl></dd>
+
+</dl>
+<hr>
+
+<h3 id="ifilt">&lt;intent-filter&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;intent-filter android:icon="<i>drawable resource</i>"
+ android:label="<i>string resource</i>"
+ android:priority="<i>integer</i>" &gt;
+ . . .
+&lt;/intent-filter&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#actv">&lt;activity&gt;</a>}
+<br/>{@code <a href="#alias">&lt;activity-alias&gt;</a>}
+<br/>{@code <a href="#srvc">&lt;service&gt;</a>}
+<br/>{@code <a href="#rcvr">&lt;receiver&gt;</a>}</dd>
+
+<dt>must contain:</dt>
+<dd>{@code <a href="#actn">&lt;action&gt;</a>}</dd>
+
+<dt>can contain:</dt>
+<dd>{@code <a href="#catg">&lt;category&gt;</a>}
+<br/>{@code <a href="#data">&lt;data&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Specifies the types of intents that an activity, service, or broadcast
+receiver can respond to. An intent filter declares the capabilities of its
+parent component &mdash; what an activity or service can do and what types
+of broadcasts a receiver can handle. It opens the component to receiving
+intents of the advertised type, while filtering out those that are not
+meaningful for the component.
+
+<p>
+Most of the contents of the filter are described by its
+{@code <a href="#actn">&lt;action&gt;</a>},
+{@code <a href="#catg">&lt;category&gt;</a>}, and
+{@code <a href="#data">&lt;data&gt;</a>} subelements.
+</p>
+
+<p>
+For a more detailed discussion of filters, see the separate
+<a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents
+and Intent Filters</a> document, as well as the
+<a href="#ifs">Intents Filters</a> section earlier in this document.
+</p></dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt><a name="ifilt_icon"></a>{@code android:icon}</dt>
+<dd>An icon that represents the parent activity, service, or broadcast
+receiver when that component is presented to the user as having the
+capability described by the filter.
+
+<p>
+This attribute must be set as a reference to a drawable resource
+containing the image definition. The default value is the icon set
+by the parent component's {@code icon} attribute. If the parent
+does not specify an icon, the default is the icon set by the
+{@code <a href="#app">&lt;application&gt;</a>} element.
+</p>
+
+<p>
+For more on intent filter icons, see <a href="#iconlabel">Icons and Labels</a>,
+earlier.
+</p></dd>
+
+<dt>{@code android:label}</dt>
+<dd>A user-readable label for the parent component. This label, rather than
+the one set by the parent component, is used when the component is presented
+to the user as having the capability described by the filter.
+
+<p>
+The label should be set as a reference to a string resource, so that
+it can be localized like other strings in the user interface.
+However, as a convenience while you're developing the application,
+it can also be set as a raw string.
+</p>
+
+<p>
+The default value is the label set by the parent component. If the
+parent does not specify a label, the default is the label set by the
+{@code <a href="#app">&lt;application&gt;</a>} element's
+{@code <a href="#app_label"> label</a>} attribute.
+</p>
+
+<p>
+For more on intent filter labels, see <a href="#iconlabel">Icons and Labels</a>,
+earlier.
+</p></dd>
+
+<dt>{@code android:priority}</dt>
+<dd>The priority that should be given to the parent component with regard
+to handling intents of the type described by the filter. This attribute has
+meaning for both activities and broadcast receivers:
+
+<ul>
+<li>It provides information about how able an activity is to respond to
+an intent that matches the filter, relative to other activities that could
+also respond to the intent. When an intent could be handled by multiple
+activities with different priorities, Android will consider only those with
+higher priority values as potential targets for the intent.</li>
+
+<li><p>It controls the order in which broadcast receivers are executed to
+receive broadcast messages. Those with higher priority
+values are called before those with lower values. (The order applies only
+to synchronous messages; it's ignored for asynchronous messages.)</p></li>
+</ul>
+
+<p>
+Use this attribute only if you really need to impose a specific order in
+which the broadcasts are received, or want to force Android to prefer
+one activity over others.
+</p>
+
+<p>
+The value must be an integer, such as "{@code 100}". Higher numbers have a
+higher priority.
+</p></dd>
+
+</dl></dd>
+
+<dt>see also:</dt>
+<dd>{@code <a href="#actn">&lt;action&gt;</a>}
+<br/>{@code <a href="#catg">&lt;category&gt;</a>}
+<br/>{@code <a href="#data">&lt;data&gt;</a>}</dd>
+
+</dl>
+<hr>
+
+
+<h3 id="manf">&lt;manifest&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="<i>string</i>"
+ android:sharedUserId="<i>string</i>"
+ android:versionCode="<i>integer</i>"
+ android:versionName="<i>string</i>" &gt;
+ . . .
+&lt;/manifest&gt;</pre></dd>
+
+<p>
+<dt>contained in:</dt>
+<dd><i>none</i></dd>
+
+<p>
+<p>
+<dt>must contain:</dt>
+<dd>{@code <a href="#app">&lt;application&gt;</a>}</dd>
+
+<dt>can contain:</dt>
+<dd>{@code <a href="#instru">&lt;instrumentation&gt;</a>}
+<br/>{@code <a href="#prmsn">&lt;permission&gt;</a>}
+<br/>{@code <a href="#pgroup">&lt;permission-group&gt;</a>}
+<br/>{@code <a href="#ptree">&lt;permission-tree&gt;</a>}
+<br/>{@code <a href="#usesp">&lt;uses-permission&gt;</a>}</dd>
+
+<p>
+<dt>description:</dt>
+<dd>The root element of the AndroidManifest.xml file. It must
+contain an {@code <a href="#app">&lt;application&gt;</a>} element
+and specify {@code xlmns:android} and {@code package} attributes.</dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code xmlns:android}</dt>
+<dd>Defines the Android namespace. This attribute should always be set
+to "{@code http://schemas.android.com/apk/res/android}".</dd>
+
+<dt><a name="manf_package"></a>{@code package}</dt>
+<dd>A full Java package name for the application. The name should
+be unique. For example, applications published by Google could have
+names in the form <code>com.google.app.<i>application_name</i></code>.
+
+<p>
+The package name serves as a unique identifier for the application.
+It's also the default name for the task affinity of components
+(see the {@code <a href="#app_aff">taskAffinity</a>} attribute).
+</p></dd>
+
+<dt>{@code android:sharedUserId}</dt>
+<dd>The name of a Linux user ID that will be shared with other applications.
+By default, Android assigns each application its own unique user ID.
+However, if this attribute is set to the same value for two or more applications,
+they will all share the same ID &mdash; provided that they are also signed
+by the same certificate. Application with the same user ID can access each
+other's data and, if desired, run in the same process.</dd>
+
+<dt>{@code android:versionCode}</dt>
+<dd>An internal version number. This number is used only to determine whether
+one version is more recent than another, with higher numbers indicating more
+recent versions. This is not the version number shown to users; that number
+is set by the {@code versionName} attribute.
+
+<p>
+The value must be set as an integer, such as "100". You can define it however
+you want, as long as each successive version has a higher number. For example,
+it could be a build number. Or you could translate a version number in "x.y"
+format to an integer by encoding the "x" and "y" separately in the lower and
+upper 16 bits. Or you could simply increase the number by one each time a new
+version is released.
+</p></dd>
+
+<dt>{@code android:versionName}</dt>
+<dd>The version number shown to users. This attribute can be set as a raw
+string or as a reference to a string resource. The string has no other purpose
+than to be displayed to users. The {@code versionCode} attribute holds
+the significant version number used internally.
+</dl></dd>
+
+<p>
+<dt>see also:</dt>
+<dd>{@code <a href="#app">&lt;application&gt;</a>}</dd>
+
+</dl>
+<hr>
+
+<h3 id="meta">&lt;meta-data&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;meta-data android:name="<i>string</i>"
+ android:resource="<i>resource specification</i>"
+ android:value="<i>string</i>" /&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#actv">&lt;activity&gt;</a>}
+<br/>{@code <a href="#alias">&lt;activity-alias&gt;</a>}
+<br/>{@code <a href="#srvc">&lt;service&gt;</a>}
+<br/>{@code <a href="#rcvr">&lt;receiver&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>A name-value pair for an item of additional, arbitrary data that can
+be supplied to the parent component. A component element can contain any
+number of {@code &lt;meta-data&gt;} subelements. The values from all of
+them are collected in a single {@link android.os.Bundle} object and made
+available to the component as the
+{@link android.content.pm.PackageItemInfo#metaData
+PackageItemInfo.metaData} field.
+
+<p>
+Ordinary values are specified through the {@code <a href="#meta_value">value</a>}
+attribute. However, to assign a resource ID as the value, use the
+{@code <a href="#meta_resource">resource</a>} attribute instead. For example,
+the following code assigns whatever value is stored in the {@code @string/kangaroo}
+resource to the "{@code zoo}" name:
+</p>
+
+<pre>&lt;meta-data android:name="zoo" android:value="@string/kangaroo" /&gt;</pre>
+
+<p>
+On the other hand, using the {@code resource} attribute would assign "{@code zoo}"
+the numeric ID of the resource, not the value stored in the resource:
+</p>
+
+<pre>&lt;meta-data android:name="zoo" android:resource="@string/kangaroo" /&gt;</pre>
+
+<p>
+It is highly recommended that you avoid supplying related data as
+multiple separate {@code &lt;meta-data&gt;} entries. Instead, if you
+have complex data to associate with a component, store it as a resource and
+use the {@code resource} attribute to inform the component of its ID.
+</p></dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:name}</dt>
+<dd>A unique name for the item. To ensure that the name is unique, use a
+Java-style naming convention &mdash; for example,
+"{@code com.example.project.activity.fred}".</dd>
+
+<dt>{@code android:resource}</dt>
+<dd>A reference to a resource. The ID of the resource is the value assigned
+to the item. The ID can be retrieved from the meta-data Bundle by the
+{@link android.os.Bundle#getInt Bundle.getInt()} method.</dd>
+
+<dt>{@code android:value}</dt>
+<dd>The value assigned to the item. The data types that can be assigned as values and the Bundle methods that components use to retrieve those values are listed in the following table:
+
+<table>
+<tr>
+ <th>Type</th>
+ <th>Bundle method</th>
+</tr><tr>
+ <td>String value, using double backslashes ({@code \\}) to escape characters
+ &mdash; such as "{@code \\n}" and "{@code \\uxxxxx}" for a Unicode character.</td>
+ <td>{@link android.os.Bundle#getString(String) getString()}</td>
+</tr><tr>
+ <td>Integer value, such as "{@code 100}"</td>
+ <td>{@link android.os.Bundle#getInt(String) getInt()}</td>
+</tr><tr>
+ <td>Boolean value, either "{@code true}" or "{@code false}"</td>
+ <td>{@link android.os.Bundle#getBoolean(String) getBoolean()}</td>
+</tr><tr>
+ <td>Color value, in the form "{@code #rgb}", "{@code #argb}",
+ "{@code #rrggbb}", or "{@code #aarrggbb}"</td>
+ <td>{@link android.os.Bundle#getString(String) getString()}</td>
+</tr><tr>
+ <td>Float value, such as "{@code 1.23}"</td>
+ <td>{@link android.os.Bundle#getFloat(String) getFloat()}</td>
+</tr>
+</table>
+</dd>
+</dl></dd>
+
+</dl>
+<hr>
+
+<h3 id="prmsn">&lt;permission&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt></dt>
+<dd><pre class="stx">&lt;permission android:description="<i>string resource</i>"
+ android:icon="<i>drawable resource</i>"
+ android:label="<i>string resource</i>"
+ android:name="<i>string</i>"
+ android:permissionGroup="<i>string</i>"
+ android:protectionLevel=["normal" | "dangerous" |
+ "signature" | "signatureOrSystem"] /&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#manf">&lt;manifest&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Declares a security permission that can be used to limit access
+to specific components or features of this or other applications.
+See the <a href="#perms">Permissions</a>, earlier in this document,
+and the <a href="{@docRoot}guide/topics/security/security.html">Security Model</a>
+document for more information on how permissions work.</dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:description}</dt>
+<dd>A user-readable description of the permission, longer and more
+informative than the label. It may be displayed to explain the
+permission to the user &mdash; for example, when the user is asked
+whether to grant the permission to another application.
+
+<p>
+This attribute must be set as a reference to a string resource;
+unlike the {@code label} attribute, it cannot be a raw string.
+</p></dd>
+
+<dt>{@code android:icon}</dt>
+<dd>A reference to a drawable resource for an icon that represents the
+permission.</dd>
+
+<dt>{@code android:label}</dt>
+<dd>A name for the permission, one that can be displayed to users.
+
+<p>
+As a convenience, the label can be directly set
+as a raw string while you're developing the application. However,
+when the application is ready to be published, it should be set as a
+reference to a string resource, so that it can be localized like other
+strings in the user interface.
+</p></dd>
+
+<dt>{@code android:name}</dt>
+<dd>The name of the permission. This is the name that will be used in
+code to refer to the permission &mdash; for example, in a
+{@code <a href="#usesp">&lt;uses-permission&gt;</a>} element and the
+{@code permission} attributes of application components.</dd>
+
+<p>
+The name must be unique, so it should use Java-style scoping &mdash;
+for example, "{@code com.example.project.PERMITTED_ACTION}".
+</p></dd>
+
+<dt>{@code android:permissionGroup}</dt>
+<dd>Assigns this permission to a group. The value of this attribute is
+the name of the group, which must be declared with the
+{@code <a href="#pgroup">&lt;permission-group&gt;</a>} element in this
+or another application. If this attribute is not set, the permission
+does not belong to a group.</dd>
+
+<dt>{@code android:protectionLevel}</dt>
+<dd>Characterizes the potential risk implied in the permission and
+indicates the procedure the system should follow when determining
+whether or not to grant the permission to an application requesting it.
+The value can be set to one of the following strings:
+
+<table>
+<tr>
+ <th>Value</th>
+ <th>Meaning</th>
+</tr><tr>
+ <td>"{@code normal}"</td>
+ <td>The default value. A lower-risk permission that gives requesting
+ applications access to isolated application-level features, with
+ minimal risk to other applications, the system, or the user.
+ The system automatically grants this type
+ of permission to a requesting application at installation, without
+ asking for the user's explicit approval (though the user always
+ has the option to review these permissions before installing).
+</tr><tr>
+ <td>"{@code dangerous}"</td>
+ <td>A higher-risk permission that would give a requesting application
+ access to private user data or control over the device that can
+ negatively impact the user. Because this type of permission
+ introduces potential risk, the system may not automatically
+ grant it to the requesting application. For example, any dangerous
+ permissions requested by an application may be displayed to the
+ user and require confirmation before proceeding, or some other
+ approach may be taken to avoid the user automatically allowing
+ the use of such facilities.
+</tr><tr>
+ <td>"{@code signature}"</td>
+ <td>A permission that the system grants only if the requesting
+ application is signed with the same certificate as the application
+ that declared the permission. If the certificates match, the system
+ automatically grants the permission without notifying the user or
+ asking for the user's explicit approval.
+</tr><tr>
+ <td>"{@code signatureOrSystem}"</td>
+ <td>A permission that the system grants only to applications that are
+ in the Android system image <em>or</em> that are signed with the same
+ certificates as those in the system image. Please avoid using this
+ option, as the {@code signature} protection level should be sufficient
+ for most needs and works regardless of exactly where applications are
+ installed. The "{@code signatureOrSystem}"
+ permission is used for certain special situations where multiple
+ vendors have applications built into a system image and need
+ to share specific features explicitly because they are being built
+ together.
+</tr>
+</table>
+</dd>
+</dl></dd>
+
+<dt>see also:</dt>
+<dd>{@code <a href="#usesp">&lt;uses-permission&gt;</a>}
+<br/>{@code <a href="#ptree">&lt;permission-tree&gt;</a>}
+<br/>{@code <a href="#pgroup">&lt;permission-group&gt;</a>}</dd>
+</dd>
+
+</dl>
+<hr>
+
+<h3 id="pgroup">&lt;permission-group&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;permission-group android:description="<i>string resource</i>"
+ android:icon="<i>drawable resource</i>"
+ android:label="<i>string resource</i>"
+ android:name="<i>string</i>" /&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#manf">&lt;manifest&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Declares a name for a logical grouping of related permissions. Individual
+permission join the group through the {@code permissionGroup} attribute of the
+{@code <a href="#prmsn">&lt;permission&gt;</a>} element. Members of a group are
+presented together in the user interface.
+
+<p>
+Note that this element does not declare a permission itself, only a category in
+which permissions can be placed. See the
+{@code <a href="#prmsn">&lt;permission&gt;</a>} element for element for information
+on declaring permissions and assigning them to groups.
+</p></dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:description}</dt>
+<dd>User-readable text that describes the group. The text should be
+longer and more explanatory than the label. This attribute must be
+set as a reference to a string resource. Unlike the {@code label}
+attribute, it cannot be a raw string.</dd>
+
+<dt>{@code android:icon}</dt>
+<dd>An icon representing the permission. This attribute must be set
+as a reference to a drawable resource containing the image definition.</dd>
+
+<dt>{@code android:label}</dt>
+<dd>A user-readable name for the group. As a convenience, the label can
+be directly set as a raw string while you're developing the application.
+However, when the application is ready to be published, it should be set
+as a reference to a string resource, so that it can be localized like other
+strings in the user interface.</dd>
+
+<dt>{@code android:name}</dt>
+<dd>The name of the group. This is the name that can be assigned to a
+{@code <a href="#prmsn">&lt;permission&gt;</a>} element's
+{@code permissionGroup} attribute.</dd>
+</dl></dd>
+
+<dt>see also:</dt>
+<dd>{@code <a href="#prmsn">&lt;permission&gt;</a>}
+<br/>{@code <a href="#ptree">&lt;permission-tree&gt;</a>}
+<br/>{@code <a href="#usesp">&lt;uses-permission&gt;</a>}</dd>
+
+</dl>
+<hr>
+
+<h3 id="ptree">&lt;permission-tree&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;permission-tree android:icon="<i>drawable resource</i>"
+ android:label="<i>string resource</i>" ]
+ android:name="<i>string</i>" /&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#manf">&lt;manifest&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Declares the base name for a tree of permissions. The application takes
+ownership of all names within the tree. It can dynamically add new permissions
+to the tree by calling <code>{@link android.content.pm.PackageManager#addPermission PackageManager.addPermission()}</code>. Names within the tree are separated by
+periods ('{@code .}'). For example, if the base name is
+{@code com.example.project.taxes}, permissions like the following might be
+added:
+
+<p style="margin-left: 2em">{@code com.example.project.taxes.CALCULATE}
+<br/>{@code com.example.project.taxes.deductions.MAKE_SOME_UP}
+<br/>{@code com.example.project.taxes.deductions.EXAGGERATE}</p>
+
+<p>
+Note that this element does not declare a permission itself, only a
+namespace in which further permissions can be placed.
+See the {@code <a href="#prmsn">&lt;permission&gt;</a>} element for
+information on declaring permissions.
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:icon}</dt>
+<dd>An icon representing all the permissions in the tree. This attribute
+must be set as a reference to a drawable resource containing the image
+definition.</dd>
+
+<dt>{@code android:label}</dt>
+<dd>A user-readable name for the group. As a convenience, the label can
+be directly set as a raw string for quick and dirty programming. However,
+when the application is ready to be published, it should be set as a
+reference to a string resource, so that it can be localized like other
+strings in the user interface.</dd>
+
+<dt>{@code android:name}</dt>
+<dd>The name that's at the base of the permission tree. It serves as
+a prefix to all permission names in the tree. Java-style scoping should
+be used to ensure that the name is unique. The name must have more than
+two period-separated seqments in its path &mdash; for example,
+{@code com.example.base} is OK, but {@code com.example} is not.</dd>
+
+</dl></dd>
+
+<p>
+<dt>see also:</dt>
+<dd>{@code <a href="#prmsn">&lt;permission&gt;</a>}
+<br/>{@code <a href="#pgroup">&lt;permission-group&gt;</a>}
+<br/>{@code <a href="#usesp">&lt;uses-permission&gt;</a>}
+</dd>
-<dl>
- <dt>{@link android.R.styleable#AndroidManifest &lt;manifest&gt;}</dt>
- <dd>The root node of the file, describing the complete contents of
- the package. Under it you can place:
- <dl>
- <dt>{@link android.R.styleable#AndroidManifestUsesPermission &lt;uses-permission&gt;}</dt>
- <dd>Requests a security permission that your package must be granted in
- order for it to operate correctly. See the
- <a href="{@docRoot}devel/security.html">Security Model</a>
- document for more information on permissions. A manifest can
- contain zero or more of these elements.</dd>
- <dt>{@link android.R.styleable#AndroidManifestPermission &lt;permission&gt;}</dt>
- <dd>Declares a security permission that can be used to restrict which
- applications can access components or features in your (or
- another) package. See the
- <a href="{@docRoot}devel/security.html">Security Model</a>
- document for more information on permissions. A manifest can
- contain zero or more of these elements.</dd>
- <dt>{@link android.R.styleable#AndroidManifestInstrumentation &lt;instrumentation&gt;}</dt>
- <dd>Declares the code of an instrumentation component that is available
- to test the functionality of this <em>or another</em> package.
- See {@link android.app.Instrumentation} for more details. A manifest can
- contain zero or more of these elements.</dd>
- <dt>{@link android.R.styleable#AndroidManifestApplication &lt;application&gt;}</dt>
- <dd>Root element containing declarations of the application-level
- components contained in the package. This element can also
- include global and/or default attributes for the application,
- such as a label, icon, theme, required permission, etc. A manifest
- can contain zero or one of these elements (more than one application
- tag is not allowed). Under it you can place zero or more of
- each of the following component declarations:
- <dl>
- <dt>{@link android.R.styleable#AndroidManifestActivity &lt;activity&gt;}</dt>
- <dd>An {@link android.app.Activity} is the primary facility for
- an application to interact with the user. The initial screen
- the user sees when launching an application is an activity,
- and most other screens they use will be implemented as
- separate activities declared with additional activity tags.
-
- <p><em><strong>Note:</strong></em> Every
- Activity must have an &lt;activity&gt; tag in the manifest whether it is exposed
- to the world or intended for use only within its own package. If an Activity
- has no matching tag in the manifest, you won't be able to launch it.
-
- <p>Optionally, to support late runtime lookup of your
- activity, you can include one or more &lt;intent-filter&gt;
- elements to describe the actions the activity supports.
- <dl>
- <dt><a name="intent-filter">
- {@link android.R.styleable#AndroidManifestIntentFilter &lt;intent-filter&gt;}</a></dt>
- <dd>Declares a specific set of {@link android.content.Intent} values
- that a component supports, in the form of an
- {@link android.content.IntentFilter}. In addition to the
- various kinds of values
- that can be specified under this element, attributes
- can be given here to supply a unique label, icon, and
- other information for the action being described.
- <dl>
- <dt>{@link android.R.styleable#AndroidManifestAction &lt;action&gt;}</dt>
- <dd>An {@link android.content.IntentFilter#addAction Intent action}
- that the component supports.</dd>
- <dt>{@link android.R.styleable#AndroidManifestCategory &lt;category&gt;}</dt>
- <dd>An {@link android.content.IntentFilter#addCategory Intent category}
- that the component supports.</dd>
- <dt>{@link android.R.styleable#AndroidManifestData &lt;data&gt;}</dt>
- <dd>An {@link android.content.IntentFilter#addDataType Intent data MIME type},
- {@link android.content.IntentFilter#addDataScheme Intent data URI scheme},
- {@link android.content.IntentFilter#addDataAuthority Intent data URI authority}, or
- {@link android.content.IntentFilter#addDataPath Intent data URI path}
- that the component supports.</dd>
- </dl>
- </dl>
-
- <p>You can also optionally associate one or more pieces of meta-data
- with your activity that other clients can retrieve to find
- additional arbitrary information about it:</p>
- <dl>
- <dt><a name="meta-data">
- {@link android.R.styleable#AndroidManifestMetaData &lt;meta-data&gt;}</a></dt>
- <dd>Adds a new piece of meta data to the activity, which clients
- can retrieve through
- {@link android.content.pm.ComponentInfo#metaData
- ComponentInfo.metaData}.
- </dl>
- <dt>{@link android.R.styleable#AndroidManifestReceiver &lt;receiver&gt;}</dt>
- <dd>An {@link android.content.BroadcastReceiver} allows an application
- to be told about changes to data or actions that happen,
- even if it is not currently running. As with the activity
- tag, you can optionally include one or more &lt;intent-filter&gt;
- elements that the receiver supports or &lt;meta-data&gt; values;
- see the activity's
- <a href="#intent-filter">&lt;intent-filter&gt;</a> and
- <a href="#meta-data">&lt;meta-data&gt;</a> descriptions
- for more information.</dd>
- <dt>{@link android.R.styleable#AndroidManifestService &lt;service&gt;}</dt>
- <dd>A {@link android.app.Service} is a component that can run in
- the background for an arbitrary amount of time. As with the activity
- tag, you can optionally include one or more &lt;intent-filter&gt;
- elements that the service supports or &lt;meta-data&gt; values;
- see the activity's
- <a href="#intent-filter">&lt;intent-filter&gt;</a> and
- <a href="#meta-data">&lt;meta-data&gt;</a> descriptions
- for more information.</dd>
- <dt>{@link android.R.styleable#AndroidManifestProvider &lt;provider&gt;}</dt>
- <dd>A {@link android.content.ContentProvider} is a component that
- manages persistent data and publishes it for access by other
- applications. You can also optionally attach one or more
- &lt;meta-data&gt; values, as described in the activity's
- <a href="#meta-data">&lt;meta-data&gt;</a> description.</dd>
- </dl>
- </dl>
</dl>
+<hr>
+
+<h3 id="pvdr">&lt;provider&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;provider android:authorities="<i>list</i>"
+ android:enabled=["true" | "false"]
+ android:exported=["true" | "false"]
+ android:grantUriPermissions=["true" | "false"]
+ android:icon="<i>drawable resource</i>"
+ android:initOrder="<i>integer</i>"
+ android:label="<i>string resource</i>"
+ android:multiprocess=["true" | "false"]
+ android:name="<i>string</i>"
+ android:permission="<i>string</i>"
+ android:process="<i>string</i>"
+ android:readPermission="<i>string</i>"
+ android:syncable=["true" | "false"]
+ android:writePermission="<i>string</i>" &gt;
+ . . .
+&lt;/provider&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#app">&lt;application&gt;</a>}</dd>
+
+<dt>can contain:</dt>
+<dd>{@code <a href="#meta">&lt;meta-data&gt;</a>}
+<br/>{@code <a href="#grantp">&lt;grant-uri-permission&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Declares a content provider &mdash; a subclass of
+{@link android.content.ContentProvider} &mdash; that supplies structured
+access to data managed by the application. All content providers that
+are part of the application must be represented by {@code &lt;provider&gt;}
+elements in the manifest file. The system cannot see, and therefore will
+not run, any that are not declared. (You need to declare only
+those content providers that you develop as part of your application,
+not those developed by others that your application uses.)
+
+<p>
+The Android system identifies content providers by the authority part
+ of a {@code content:} URI. For example, suppose that the following URI
+is passed to <code>{@link android.content.ContentResolver#query
+ContentResolver.query()}</code>:
+
+<p style="margin-left: 2em">{@code content://com.example.project.healthcareprovider/nurses/rn}</p>
+
+<p>
+The {@code content:} scheme identifies the data as belonging to a content
+provider and the authority ({@code com.example.project.healthcareprovider})
+identifies the particular provider. The authority therefore must be unique.
+Typically, as in this example, it's the fully qualified name of a
+ContentProvider subclass. The path part of a URI may be used by a content
+provider to identify particular data subsets, but those paths are not
+declared in the manifest.
+</p>
+
+<p>
+For information on using and developing content providers, see a separate document,
+<a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>.
+</p></dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:authorities}</dt>
+<dd>A list of one or more URI authorities that identify data under the purview
+of the content provider.
+Multiple authorities are listed by separating their names with a semicolon.
+To avoid conflicts, authority names should use a Java-style naming convention
+(such as {@code com.example.provider.cartoonprovider}). Typically, it's the name
+of the ContentProvider subclass.
+
+<p>
+There is no default. At least one authority must be specified.
+</p></dd>
+
+<dt>{@code android:enabled}</dt>
+<dd>Whether or not the content provider can be instantiated by the system &mdash;
+"{@code true}" if it can be, and "{@code false}" if not. The default value
+is "{@code true}".
+
+<p>
+The {@code <a href="#app">&lt;application&gt;</a>} element has its own
+{@code <a href="#app_enabled">enabled</a>} attribute that applies to all
+application components, including content providers. The
+{@code <a href="#app">&lt;application&gt;</a>} and {@code &lt;provider&gt;}
+attributes must both be "{@code true}" (as they both
+are by default) for the content provider to be enabled. If either is
+"{@code false}", the provider is disabled; it cannot be instantiated.
+</p></dd>
+
+<dt>{@code android:exported}</dt>
+<dd>Whether or not the content provider can be used by components of other
+applications &mdash; "{@code true}" if it can be, and "{@code false}" if not.
+If "{@code false}", the provider is available only to components of the
+same application or applications with the same user ID. The default value
+is "{@code true}".
+
+<p>
+You can export a content provider but still limit access to it with the
+{@code <a href="#pvdr_prmsn">permission</a>} attribute.
+</p></dd>
+
+<dt><a name="grantp_gprmns"></a>{@code android:grantUriPermissions}</dt>
+<dd>Whether or not those who ordinarily would not have permission to
+access the content provider's data can be granted permission to do so,
+temporarily overcoming the restriction imposed by the
+{@code <a href="#pvdr_rprmsn">readPermission</a>},
+{@code <a href="#pvdr_wprmsn">writePermission</a>}, and
+{@code <a href="#pvdr_prmsn">permission</a>} attributes
+&mdash;
+"{@code true}" if permission can be granted, and "{@ code false}" if not.
+If "{@code true}", permission can be granted to any of the content
+provider's data. If "{@code false}", permission can be granted only
+to the data subsets listed in
+{@code <a href="#grantp">&lt;grant-uri-permission&gt;</a>} subelements,
+if any. The default value is "{@code false}".
+
+<p>
+Granting permission is a way of giving an application component one-time
+access to data protected by a permission. For example, when an e-mail
+message contains an attachment, the mail application may call upon the
+appropriate viewer to open it, even though the viewer doesn't have general
+permission to look at all the content provider's data.
+</p>
+
+<p>
+In such cases, permission is granted by
+<code>{@link android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION}</code>
+and <code>{@link android.content.Intent#FLAG_GRANT_WRITE_URI_PERMISSION}</code>
+flags in the Intent object that activates the component. For example, the
+mail application might put {@code FLAG_GRANT_READ_URI_PERMISSION} in the
+Intent passed to {@code Context.startActivity()}. The permission is specific
+to the URI in the Intent.
+</p>
+
+<p>
+If you enable this feature, either by setting this attribute to "{@code true}"
+or by defining {@code <a href="#grantp">&lt;grant-uri-permission&gt;</a>}
+subelements, you must call
+<code>{@link android.content.Context#revokeUriPermission
+Context.revokeUriPermission()}</code> when a covered URI is deleted from
+the provider.
+</p>
+
+<p>
+See also the {@code <a href="#grantp">&lt;grant-uri-permission&gt;</a>}
+element.
+</p></dd>
+
+<dt><a name="pvdr_icon"></a>{@code android:icon}</dt>
+<dd>An icon representing the content provider.
+This attribute must be set as a reference to a drawable resource containing
+the image definition. If it is not set, the icon specified for the application
+as a whole is used instead (see the {@code <a href="#app">&lt;application&gt;</a>}
+element's {@code <a href="#app_icon">icon</a>} attribute).</dd>
+
+<dt>{@code android:initOrder}</dt>
+<dd>The order in which the content provider should be instantiated,
+relative to other content providers hosted by the same process.
+When there are dependencies among content providers, setting this
+attribute for each of them ensures that they are created in the order
+required by those dependencies. The value is a simple integer,
+with higher numbers being initialized first.</dd>
+
+<dt>{@code android:label}</dt>
+<dd>A user-readable label for the content provided.
+If this attribute is not set, the label set for the application as a whole is
+used instead (see the {@code <a href="#app">&lt;application&gt;</a>} element's
+{@code <a href="#app_label">label</a>} attribute).
+
+<p>
+The label should be set as a reference to a string resource, so that
+it can be localized like other strings in the user interface.
+However, as a convenience while you're developing the application,
+it can also be set as a raw string.
+</p></dd>
+
+<dt>{@code android:multiprocess}</dt>
+<dd>Whether or not an instance of the content provider can be created in
+every client process &mdash; "{@code true}" if instances can run in multiple
+processes, and "{@code false}" if not. The default value is "{@code false}".
+
+<p>
+Normally, a content provider is instantiated in the process of the
+application that defined it. However, if this flag is set to "{@code true}",
+the system can create an instance in every process where there's a client
+that wants to interact withit, thus avoiding the overhead of interprocess
+communication.
+</p></dd>
+
+<dt>{@code android:name}</dt>
+<dd>The name of the class that implements the content provider, a subclass of
+{@link android.content.ContentProvider}. This should be a fully qualified
+class name (such as, "{@code com.example.project.TransportationProvider}").
+However, as a shorthand, if the first character of the name is a period,
+it is appended to the package name specified in the
+{@code <a href="#manf">&lt;manifest&gt;</a>} element.
+
+<p>
+There is no default. The name must be specified.
+</p></dd>
+
+
+<dt>{@code android:permission}</dt>
+<dd>The name of a permission that clients must have to read or write the
+content provider's data. This attribute is a convenient way of setting a
+single permission for both reading and writing. However, the
+{@code <a href="#pvdr_rprmsn">readPermission</a>} and
+{@code <a href="#pvdr_wprmsn">writePermission</a>} attributes take precedence
+over this one. If the {@code <a href="#pvdr_rprmsn">readPermission</a>}
+attribute is also set, it controls access for querying the content provider.
+And if the {@code <a href="#pvdr_wprmsn">writePermission</a>} attribute is set,
+it controls access for modifying the provider's data.
+
+<p>
+For more information on permissions, see the <a href="#sectperm">Permissions</a>
+section earlier in this document and a separate document,
+<a href="{@docRoot}guide/topics/security/security.html">Security and
+Permissions</a>.
+</p></dd>
+
+<dt>{@code android:process}</dt>
+<dd>The name of the process in which the content provider should run. Normally,
+all components of an application run in the default process created for the
+application. It has the same name as the application package. The {@code <a href="#app">&lt;application&gt;</a>} element's
+{@code <a href="#app_proc">process</a>} attribute can set a different
+default for all components. But each component can override the default
+with its own {@code process} attribute, allowing you to spread your
+application across multiple processes.
+
+<p>
+If the name assigned to this attribute begins with a colon (':'), a new
+process, private to the application, is created when it's needed and
+the activity runs in that process.
+If the process name begins with a lowercase character, the activity will run
+in a global process of that name, provided that it has permission to do so.
+This allows components in different applications to share a process, reducing
+resource usage.
+</p></dd>
+
+<dt>{@code android:readPermission}</dt>
+<dd>A permission that clients must have to query the content provider.
+See also the {@code <a href="#pvdr_prmsn">permission</a>} and
+{@code <a href="#pvdr_wprmsn">writePermission</a>} attributes.</dd>
+
+<dt>{@code android:syncable}</dt>
+<dd>Whether or not the data under the content provider's control
+is to be synchronized with data on a server &mdash; "{@code true}"
+if it is to be synchronized, and "{@ code false}" if not.</dd>
+
+<dt>{@code android:writePermission}</dt>
+<dd>A permission that clients must have to make changes to the data
+controlled by the content provider.
+See also the {@code <a href="#pvdr_prmsn">permission</a>} and
+{@code <a href="#pvdr_rprmsn">readPermission</a>} attributes.</dd>
+
+</dl></dd>
+
+<p>
+<dt>see also:</dt>
+<dd><a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a></dd>
+
+</dl>
+<hr>
+
+<h3 id="rcvr">&lt;receiver&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;receiver android:enabled=["true" | "false"]
+ android:exported=["true" | "false"]
+ android:icon="<i>drawable resource</i>"
+ android:label="<i>string resource</i>"
+ android:name="<i>string</i>"
+ android:permission="<i>string</i>"
+ android:process="<i>string</i>" &gt;
+ . . .
+&lt;/receiver&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#app">&lt;application&gt;</a>}</dd>
+
+<dt>can contain:</dt>
+<dd>{@code <a href="#ifilt">&lt;intent-filer&gt;</a>}
+<br/>{@code <a href="#meta">&lt;meta-data&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Declares a broadcast receiver (a {@link android.content.BroadcastReceiver}
+subclass) as one of the application's components. Broadcast receivers enable
+applications to receive intents that are broadcast by the system or by other
+applications, even when other components of the application are not running.
+
+<p>
+There are two ways to make a broadcast receiver known to the system: One is
+declare it in the manifest file with this element. The other is to create
+the receiver dynamically in code and register it with the <code>{@link
+android.content.Context#registerReceiver Context.registerReceiver()}</code>
+method. See the {@link android.content.BroadcastReceiver} class description
+for more on dynamically created receivers.
+</p></dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:enabled}</dt>
+<dd>Whether or not the broadcast receiver can be instantiated by the system &mdash;
+"{@code true}" if it can be, and "{@code false}" if not. The default value
+is "{@code true}".
+
+<p>
+The {@code <a href="#app">&lt;application&gt;</a>} element has its own
+{@code <a href="#app_enabled">enabled</a>} attribute that applies to all
+application components, including broadcast receivers. The
+{@code <a href="#app">&lt;application&gt;</a>} and
+{@code &lt;receiver&gt;} attributes must both be "{@code true}" for
+the broadcast receiver to be enabled. If either is "{@code false}", it is
+disabled; it cannot be instantiated.
+</p></dd>
+
+<dt>{@code android:exported}</dt>
+<dd>Whether or not the broadcast receiver can receive messages from sources
+outside its application &mdash; "{@code true}" if it can, and "{@code false}"
+if not. If "{@code false}", the only messages the broadcast receiver can
+receive are those sent by components of the same application or applications
+with the same user ID.
+
+<p>
+The default value depends on whether the broadcast receiver contains intent filters.
+The absence of any filters means that it can be invoked only by Intent objects that
+specify its exact class name. This implies that the receiver is intended only for
+application-internal use (since others would not normally know the class name).
+So in this case, the default value is "{@code false}".
+On the other hand, the presence of at least one filter implies that the broadcast
+receiver is intended to receive intents broadcast by the system or other applications,
+so the default value is "{@code true}".
+</p>
+
+<p>
+This attribute is not the only way to limit a broadcast receiver's external exposure.
+You can also use a permission to limit the external entities that can send it messages
+(see the {@code <a href="#rcvr_prmsn">permission</a>} attribute).
+</p></dd>
+
+<dt><a name="rcvr_icon"></a>{@code android:icon}</dt>
+<dd>An icon representing the broadcast receiver. This attribute must be set
+as a reference to a drawable resource containing the image definition.
+If it is not set, the icon specified for the application as a whole is used
+instead (see the {@code <a href="#app">&lt;application&gt;</a>}
+element's {@code <a href="#app_icon">icon</a>} attribute).
+
+<p>
+The broadcast receiver's icon &mdash; whether set here or by the
+{@code <a href="#app">&lt;application&gt;</a>} element &mdash; is also the
+default icon for all the receiver's intent filters (see the
+{@code <a href="#ifilt">&lt;intent-filter&gt;</a>} element's
+{@code <a href="#ifilt_icon">icon</a>} attribute).
+</p></dd>
+
+<dt>{@code android:label}</dt>
+<dd>A user-readable label for the broadcast receiver. If this attribute is not
+set, the label set for the application as a whole is
+used instead (see the {@code <a href="#app">&lt;application&gt;</a>} element's
+{@code <a href="#app_label">label</a>} attribute).
+
+<p>
+The broadcast receiver's label &mdash; whether set here or by the
+{@code <a href="#app">&lt;application&gt;</a>} element &mdash; is also the
+default label for all the receiver's intent filters (see the
+{@code <a href="#ifilt">&lt;intent-filter&gt;</a>} element's
+{@code <a href="#ifilt_label">label</a>} attribute).
+</p>
+
+<p>
+The label should be set as a reference to a string resource, so that
+it can be localized like other strings in the user interface.
+However, as a convenience while you're developing the application,
+it can also be set as a raw string.
+</p></dd>
+
+<dt>{@code android:name}</dt>
+<dd>The name of the class that implements the broadcast receiver, a subclass of
+{@link android.content.BroadcastReceiver}. This should be a fully qualified
+class name (such as, "{@code com.example.project.ReportReceiver}"). However,
+as a shorthand, if the first character of the name is a period (for example,
+"{@code . ReportReceiver}"), it is appended to the package name specified in
+the {@code <a href="#manf">&lt;manifest&gt;</a>} element.
+
+<p>
+There is no default. The name must be specified.
+</p></dd>
+
+<dt><a name="rcvr_prmsn"></a>{@code android:permission}</dt>
+<dd>The name of a permission that broadcasters must have to send a
+message to the broadcast receiver.
+If this attribute is not set, the permission set by the
+{@code <a href="#app">&lt;application&gt;</a>} element's
+{@code <a href="#app_prmsn">permission</a>} attribute applies
+to the broadcast receiver. If neither attribute is set, the receiver
+is not protected by a permission.
+
+<p>
+For more information on permissions, see the <a href="#sectperm">Permissions</a>
+section earlier in this document and a separate document,
+<a href="{@docRoot}guide/topics/security/security.html">Security and
+Permissions</a>.
+</p></dd>
+
+<dt>{@code android:process}</dt>
+<dd>The name of the process in which the broadcast receiver should run.
+Normally, all components of an application run in the default process created
+for the application. It has the same name as the application package. The
+{@code <a href="#app">&lt;application&gt;</a>} element's
+{@code <a href="#app_proc">process</a>} attribute can set a different
+default for all components. But each component can override the default
+with its own {@code process} attribute, allowing you to spread your
+application across multiple processes.
+
+<p>
+If the name assigned to this attribute begins with a colon (':'), a new
+process, private to the application, is created when it's needed and
+the broadcast receiver runs in that process.
+If the process name begins with a lowercase character, the receiver will run
+in a global process of that name, provided that it has permission to do so.
+This allows components in different applications to share a process, reducing
+resource usage.
+</p></dd>
+</dl></dd>
+
+</dl>
+<hr>
+
+<h3 id="srvc">&lt;service&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;service android:enabled=["true" | "false"]
+ android:exported[="true" | "false"]
+ android:icon="<i>drawable resource</i>"
+ android:label="<i>string resource</i>"
+ android:name="<i>string</i>"
+ android:permission="<i>string</i>"
+ android:process="<i>string</i>" &gt;
+ . . .
+&lt;/service&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#app">&lt;application&gt;</a>}</dd>
+
+<dt>can contain:</dt>
+<dd>{@code <a href="#ifilt">&lt;intent-filer&gt;</a>}
+<br/>{@code <a href="#meta">&lt;meta-data&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Declares a service (a {@link android.app.Service} subclass) as one
+of the application's components. Unlike activities, services lack a
+visual user interface. They're used to implement long-running background
+operations or a rich communications API that can be called by other
+applications.
+
+<p>
+All services must be represented by {@code &lt;service&gt;} elements in
+the manifest file. Any that are not declared there will not be seen
+by the system and will never be run.
+</p></dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:enabled}</dt>
+<dd>Whether or not the service can be instantiated by the system &mdash;
+"{@code true}" if it can be, and "{@code false}" if not. The default value
+is "{@code true}".
+
+<p>
+The {@code <a href="#app">&lt;application&gt;</a>} element has its own
+{@code <a href="#app_enabled">enabled</a>} attribute that applies to all
+application components, including services. The
+{@code <a href="#app">&lt;application&gt;</a>} and {@code &lt;service&gt;}
+attributes must both be "{@code true}" (as they both
+are by default) for the service to be enabled. If either is
+"{@code false}", the service is disabled; it cannot be instantiated.
+</p></dd>
+
+<dt>{@code android:exported}</dt>
+<dd>Whether or not components of other applications can invoke
+the service or interact with it &mdash; "{@code true}" if they can, and
+"{@code false}" if not. When the value is "{@code false}", only
+components of the same application or applications
+with the same user ID can start the service or bind to it.
+
+<p>
+The default value depends on whether the service contains intent filters. The
+absence of any filters means that it can be invoked only by specifying
+its exact class name. This implies that the service is intended only for
+application-internal use (since others would not know the class name). So in
+this case, the default value is "{@code false}".
+On the other hand, the presence of at least one filter implies that the service
+is intended for external use, so the default value is "{@code true}".
+</p>
+
+<p>
+This attribute is not the only way to limit the exposure of a service to other
+applications. You can also use a permission to limit the external entities that
+can interact with the service (see the {@code <a href="#srvc_prmsn">permission</a>}
+attribute).
+</p></dd>
+
+<dt><a name="srvc_icon"></a>{@code android:icon}</dt>
+<dd>An icon representing the service. This attribute must be set as a
+reference to a drawable resource containing the image definition.
+If it is not set, the icon specified for the application
+as a whole is used instead (see the {@code <a href="#app">&lt;application&gt;</a>}
+element's {@code <a href="#app_icon">icon</a>} attribute).
+</p>
+
+<p>
+The service's icon &mdash; whether set here or by the
+{@code <a href="#app">&lt;application&gt;</a>} element &mdash; is also the
+default icon for all the service's intent filters (see the
+{@code <a href="#ifilt">&lt;intent-filter&gt;</a>} element's
+{@code <a href="#ifilt_icon">icon</a>} attribute).
+</p></dd>
+
+<dt>{@code android:label}</dt>
+<dd>A name for the service that can be displayed to users.
+If this attribute is not set, the label set for the application as a whole is
+used instead (see the {@code <a href="#app">&lt;application&gt;</a>} element's
+{@code <a href="#app_label">label</a>} attribute).
+
+<p>
+The service's label &mdash; whether set here or by the
+{@code <a href="#app">&lt;application&gt;</a>} element &mdash; is also the
+default label for all the service's intent filters (see the
+{@code <a href="#ifilt">&lt;intent-filter&gt;</a>} element's
+{@code <a href="#ifilt_label">label</a>} attribute).
+</p>
+
+<p>
+The label should be set as a reference to a string resource, so that
+it can be localized like other strings in the user interface.
+However, as a convenience while you're developing the application,
+it can also be set as a raw string.
+</p></dd>
+
+<dt>{@code android:name}</dt>
+<dd>The name of the {@link android.app.Service} subclass that implements
+the service. This should be a fully qualified class name (such as,
+"{@code com.example.project.RoomService}"). However, as a shorthand, if
+the first character of the name is a period (for example, "{@code .RoomService}"),
+it is appended to the package name specified in the
+{@code <a href="#manf">&lt;manifest&gt;</a>} element.
+
+<p>
+There is no default. The name must be specified.
+</p></dd>
+
+<dt><a name="srvc_prmsn"></a>{@code android:permission}</dt>
+<dd>The name of a permission that that an entity must have in order to
+launch the service or bind to it. If a caller of
+<code>{@link android.content.Context#startService startService()}</code>,
+<code>{@link android.content.Context#bindService bindService()}</code>, or
+<code>{@link android.content.Context#stopService stopService()}</code>,
+has not been granted this permission, the method will not work and the
+Intent object will not be delivered to the service.
+
+<p>
+If this attribute is not set, the permission set by the
+{@code <a href="#app">&lt;application&gt;</a>} element's
+{@code <a href="#app_prmsn">permission</a>} attribute applies
+to the service. If neither attribute is set, the service is
+not protected by a permission.
+</p>
+
+<p>
+For more information on permissions, see the <a href="#sectperm">Permissions</a>
+section earlier in this document and a separate document,
+<a href="{@docRoot}guide/topics/security/security.html">Security and
+Permissions</a>.
+</p></dd>
+
+<dt>{@code android:process}</dt>
+<dd>The name of the process where the service is to run. Normally,
+all components of an application run in the default process created for the
+application. It has the same name as the application package. The
+{@code <a href="#app">&lt;application&gt;</a>} element's
+{@code <a href="#app_proc">process</a>} attribute can set a different
+default for all components. But component can override the default
+with its own {@code process} attribute, allowing you to spread your
+application across multiple processes.
+
+<p>
+If the name assigned to this attribute begins with a colon (':'), a new
+process, private to the application, is created when it's needed and
+the service runs in that process.
+If the process name begins with a lowercase character, the service will run
+in a global process of that name, provided that it has permission to do so.
+This allows components in different applications to share a process, reducing
+resource usage.
+</p></dd>
+</dl></dd>
+
+<dt>see also:</dt>
+<dd>{@code <a href="#app">&lt;application&gt;</a>}
+<br>{@code <a href="#actv">&lt;activity&gt;</a>}</dd>
+
+</dl>
+<hr>
+
+<h3 id="usesl">&lt;uses-library&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre>&lt;uses-library android:name="<i>string</i>" /&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#app">&lt;application&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Specifies a shared library that the application must be linked against.
+This element tells the system to include the library's code in the class
+loader for the package.
+
+<p>
+All of the {@code android} packages (such as {@link android.app},
+{@link android.content}, {@link android.view}, and {@link android.widget})
+are in the default library that all applications are automatically linked
+against. However, some packages (such as {@code maps} and {@code awt} are
+in separate libraries that are not automatically linked. Consult the
+documentation for the packages you're using to determine which library
+contains the package code.
+</p></dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:name}</dt>
+<dd>The name of the library.</dd>
+</dl></dd>
+
+</dl>
+<hr>
+
+
+<h3 id="usesp">&lt;uses-permission&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;uses-permission android:name="<i>string</i>" /&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#manf">&lt;manifest&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Requests a permission that the application must be granted in
+order for it to operate correctly. Permissions are granted when the
+application is installed, not while it's running.
+
+<p>
+For more information on permissions, see the
+{@code <a href="#perms">Permissions</a>} section earlier in this document
+and the separate <a href="{@docRoot}guide/topics/security/security.html">Security Model</a>
+document.
+A list of permissions defined by the base platform can be found at
+{@link android.Manifest.permission android.Manifest.permission}.
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:name}</dt>
+<dd>The name of the permission. It can be a permission defined by the
+application with the {@code <a href="#prmsn">&lt;permission&gt;</a>}
+element, a permission defined by another application, or one of the
+standard system permissions, such as "{@code android.permission.CAMERA}"
+or "{@code android.permission.READ_CONTACTS}". As these examples show,
+a permission name typically includes the package name as a prefix.</dd>
+
+</dl></dd>
+
+<dt>see also:</dt>
+<dd>{@code <a href="#prmsn">&lt;permission&gt;</a>}</dd>
+
+</dl>
+<hr>
+
+
+<h3 id="usess">&lt;uses-sdk&gt;</h3>
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;uses-sdk android:minSdkVersion="<i>integer</i>" /&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd>{@code <a href="#manf">&lt;manifest&gt;</a>}</dd>
+
+<dt>description:</dt>
+<dd>Declares which versions of the Android SDK (software development kit)
+the application can run against. The version number is incremented when
+there are additions to the API and resource tree, so an application developed
+using version 3 of the SDK may not run against versions 1 or 2, but should
+run against version 3, 4, 5, and above.
+
+<p>
+The default is version 1. The current version is also 1.
+</p></dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code android:minSdkVersion}</dt>
+<dd>An integer designating the minimum version of the SDK that's required
+for the application to run.</dd>
+
+</dl></dd>
+
+</dl>
+
+
diff --git a/docs/html/guide/topics/media/index.jd b/docs/html/guide/topics/media/index.jd
new file mode 100644
index 0000000..ba6d89f
--- /dev/null
+++ b/docs/html/guide/topics/media/index.jd
@@ -0,0 +1,188 @@
+page.title=Audio and Video
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+
+<h2>Audio/Video quickview</h2>
+<ul>
+<li>Audio playback and record</li>
+<li>Video playback</li>
+<li>Handles data from raw resources, files, streams</li>
+<li>Built-in codecs for a variety of media. See <a href="{@docRoot}guide/appendix/media-formats.html">Android 1.0 Media Formats</a></li>
+</ul>
+
+<h2>Key classes</h2>
+<ol>
+<li><a href="{@docRoot}reference/android/media/MediaPlayer.html">MediaPlayer</a> (all audio and video formats)</li>
+<li><a href="{@docRoot}reference/android/media/MediaRecorder.html">MediaRecorder</a> (record, all audio formats)</li>
+</ol>
+
+<h2>In this document</h2>
+<ol>
+<li><a href="#playback.html">Audio and Video Playback</a></li>
+<li><a href="#capture">Audio Capture</a></li>
+</ol>
+
+<h2>See also</h2>
+<ol>
+<li><a href="{@docRoot}guide/topics/data/data-storage.html">Data Storage</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>The Android platform offers built-in encoding/decoding for a variety of
+common media types, so that you can easily integrate audio, video, and images into your
+applications. Accessing the platform's media capabilities is fairly straightforward
+&mdash; you do so using the same intents and activities mechanism that the rest of
+Android uses.</p>
+
+<p>Android lets you play audio and video from several types of data sources. You
+can play audio or video from media files stored in the application's resources
+(raw resources), from standalone files in the filesystem, or from a data stream
+arriving over a network connection. To play audio or video from your
+application, use the {@link android.media.MediaPlayer} class.</p>
+
+<p>The platform also lets you record audio, where supported by the mobile device
+hardware. Recording of video is not currently supported, but is planned for a
+future release. To record audio, use the
+{@link android.media.MediaRecorder} class. Note that the emulator doesn't have
+hardware to capture audio, but actual mobile devices are likely to provide these
+capabilities that you can access through MediaRecorder. </p>
+
+<p>For a list of the media formats for which Android offers built-in support,
+see the <a href="{@docRoot}guide/appendix/media-formats.html">Android Media
+Formats</a> appendix. </p>
+
+<h2 id="play">Audio and Video Playback</h2>
+<p>Media can be played from anywhere: from a raw resource, from a file from the system,
+or from an available network (URL).</p>
+
+<p>You can play back the audio data only to the standard
+output device; currently, that is the mobile device speaker or Bluetooth headset. You
+cannot play sound files in the conversation audio. </p>
+
+<h3 id="playraw">Playing from a Raw Resource</h3>
+<p>Perhaps the most common thing to want to do is play back media (notably sound)
+within your own applications. Doing this is easy:</p>
+<ol>
+ <li>Put the sound (or other media resource) file into the <code>res/raw</code>
+ folder of your project, where the Eclipse plugin (or aapt) will find it and
+ make it into a resource that can be referenced from your R class</li>
+ <li>Create an instance of <code>MediaPlayer</code>, referencing that resource using
+ {@link android.media.MediaPlayer#create MediaPlayer.create}, and then call
+ {@link android.media.MediaPlayer#start() start()} on the instance:</li>
+</ol>
+<pre>
+ MediaPlayer mp = MediaPlayer.create(context, R.raw.sound_file_1);
+ mp.start();
+</pre>
+<p>To stop playback, call {@link android.media.MediaPlayer#stop() stop()}. If
+you wish to later replay the media, then you must
+{@link android.media.MediaPlayer#reset() reset()} and
+{@link android.media.MediaPlayer#prepare() prepare()} the MediaPlayer object
+before calling {@link android.media.MediaPlayer#start() start()} again.
+(<code>create()</code> calls <code>prepare()</code> the first time.)</p>
+<p>To pause playback, call {@link android.media.MediaPlayer#pause() pause()}.
+Resume playback from where you paused with
+{@link android.media.MediaPlayer#start() start()}.</p>
+
+<h3 id="playfile">Playing from a File or Stream</h3>
+<p>You can play back media files from the filesystem or a web URL:</p>
+<ol>
+ <li>Create an instance of the <code>MediaPlayer</code> using <code>new</code></li>
+ <li>Call {@link android.media.MediaPlayer#setDataSource setDataSource()}
+ with a String containing the path (local filesystem or URL)
+ to the file you want to play</li>
+ <li>First {@link android.media.MediaPlayer#prepare prepare()} then
+ {@link android.media.MediaPlayer#start() start()} on the instance:</li>
+</ol>
+<pre>
+ MediaPlayer mp = new MediaPlayer();
+ mp.setDataSource(PATH_TO_FILE);
+ mp.prepare();
+ mp.start();
+</pre>
+<p>{@link android.media.MediaPlayer#stop() stop()} and
+{@link android.media.MediaPlayer#pause() pause()} work the same as discussed
+above.</p>
+ <p class="note"><strong>Note:</strong> It is possible that <code>mp</code> could be
+ null, so good code should <code>null</code> check after the <code>new</code>.
+ Also, <code>IllegalArgumentException</code> and <code>IOException</code> either
+ need to be caught or passed on when using <code>setDataSource()</code>, since
+ the file you are referencing may not exist.</p>
+<p class="note"><strong>Note:</strong>
+If you're passing a URL to an online media file, the file must be capable of
+progressive download.</p>
+
+<h2 id="capture">Audio Capture</h2>
+<p>Audio capture from the device is a bit more complicated than audio/video playback, but still fairly simple:</p>
+<ol>
+ <li>Create a new instance of {@link android.media.MediaRecorder
+ android.media.MediaRecorder} using <code>new</code></li>
+ <li>Create a new instance of {@link android.content.ContentValues
+ android.content.ContentValues} and put in some standard properties like
+ <code>TITLE</code>, <code>TIMESTAMP</code>, and the all important
+ <code>MIME_TYPE</code></li>
+ <li>Create a file path for the data to go to (you can use {@link
+ android.content.ContentResolver android.content.ContentResolver} to
+ create an entry in the Content database and get it to assign a path
+ automatically which you can then use)</li>
+ <li>Set the audio source using {@link android.media.MediaRecorder#setAudioSource
+ MediaRecorder.setAudioSource()}. You will probably want to use
+ <code>MediaRecorder.AudioSource.MIC</code></li>
+ <li>Set output file format using {@link
+ android.media.MediaRecorder#setOutputFormat MediaRecorder.setOutputFormat()}
+ </li>
+ <li>Set the audio encoder using
+ {@link android.media.MediaRecorder#setAudioEncoder MediaRecorder.setAudioEncoder()}
+ </li>
+ <li>Call {@link android.media.MediaRecorder#prepare prepare()}
+ on the MediaRecorder instance.</li>
+ <li>To start audio capture, call
+ {@link android.media.MediaRecorder#start start()}. </li>
+ <li>To stop audio capture, call {@link android.media.MediaRecorder#stop stop()}.
+ <li>When you are done with the MediaRecorder instance, call
+{@link android.media.MediaRecorder#release release()} on it. </li>
+</ol>
+
+<h3>Example: Audio Capture Setup and Start</h3>
+<p>The example below illustrates how to set up, then start audio capture.</p>
+<pre>
+ recorder = new MediaRecorder();
+ ContentValues values = new ContentValues(3);
+
+ values.put(MediaStore.MediaColumns.TITLE, SOME_NAME_HERE);
+ values.put(MediaStore.MediaColumns.TIMESTAMP, System.currentTimeMillis());
+ values.put(MediaStore.MediaColumns.MIME_TYPE, recorder.getMimeContentType());
+
+ ContentResolver contentResolver = new ContentResolver();
+
+ Uri base = MediaStore.Audio.INTERNAL_CONTENT_URI;
+ Uri newUri = contentResolver.insert(base, values);
+
+ if (newUri == null) {
+ // need to handle exception here - we were not able to create a new
+ // content entry
+ }
+
+ String path = contentResolver.getDataFilePath(newUri);
+
+ // could use setPreviewDisplay() to display a preview to suitable View here
+
+ recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
+ recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
+ recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
+ recorder.setOutputFile(path);
+
+ recorder.prepare();
+ recorder.start();
+</pre>
+<h3>Stop Recording</h3>
+<p>Based on the example above, here's how you would stop audio capture. </p>
+<pre>
+ recorder.stop();
+ recorder.release();
+</pre>
+
diff --git a/docs/html/guide/topics/media/media.jd b/docs/html/guide/topics/media/media.jd
index 16ad2b7..463686d 100644
--- a/docs/html/guide/topics/media/media.jd
+++ b/docs/html/guide/topics/media/media.jd
@@ -28,6 +28,7 @@ page.title=Media Capabilities
<li>{@link android.media.MediaPlayer} (playback, all audio and video formats)</li>
<li>{@link android.media.MediaRecorder} (record, all audio formats)</li>
</ul>
+</div>
<p>The Android platform offers built-in encoding/decoding for a variety of common media types,
so that you can easily integrate audio, video, and images into your applications. Accessing the platform's media
diff --git a/docs/html/guide/topics/providers/content-providers.jd b/docs/html/guide/topics/providers/content-providers.jd
index 93b379e..86dcebf 100644
--- a/docs/html/guide/topics/providers/content-providers.jd
+++ b/docs/html/guide/topics/providers/content-providers.jd
@@ -1,12 +1,31 @@
page.title=Content Providers
@jd:body
-<h1>Content Providers</h1>
+<div id="qv-wrapper">
+<div id="qv">
+<h2>Key classes</h2>
+<ol>
+<li>{@link android.content.ContentProvider}</li>
+<li>{@link android.content.ContentResolver}</li>
+<li>{@link android.database.Cursor}</li>
+</ol>
+
+<h2>In this document</h2>
+<ol>
+<li><a href="#basics">Content provider basics</a></li>
+<li><a href="#querying">Querying a content provider</a></li>
+<li><a href="#modifying">Modifying data in a provider</a></li>
+<li><a href="#creating">Creating a content provider</a></li>
+<li><a href="#urisum">Content URI summary</a></li>
+</ol>
+</div>
+</div>
<p>
Content providers store and retrieve data and make it accessible to all
applications. They're the only way to share data across applications; there's
-no common storage area that all Android packages can access.
+no common storage area that all Android packages can access.
+</p>
<p>
Android ships with a number of content providers for common data types
@@ -14,30 +33,31 @@ Android ships with a number of content providers for common data types
see some of them listed in the {@link android.provider android.provider}
package. You can query these providers for the data they contain (although,
for some, you must acquire the proper permission to read the data).
+</p>
<p>
If you want to make your own data public, you have two options: You can
create your own content provider (a {@link android.content.ContentProvider}
subclass) or you can add the data to an existing provider &mdash; if there's
one that controls the same type of data and you have permission to write to it.
+</p>
<p>
-This document is an introduction to using content providers. It explores
-the following topics:
+This document is an introduction to using content providers. After a
+brief discussion of the fundamentals, it explores how to query a content
+provider, how to modify data controlled by a provider, and how to create
+a content provider of your own.
+</p>
-<dl><dd><a href="#basics">Content provider basics</a>
-<br/><a href="#querying">Querying a content provider</a>
-<br/><a href="#modifying">Modifying data in a provider</a>
-<br/><a href="#creating">Creating a content provider</a></dd></dl>
-
-<h2>Content Provider Basics<a href="#basics"></a></h2>
+<h2><a name="basics"></a>Content Provider Basics</h2>
<p>
How a content provider actually stores its data under the covers is
up to its designer. But all content providers implement a common interface
for querying the provider and returning results &mdash; as well as for
adding, altering, and deleting data.
+</p>
<p>
It's an interface that clients use indirectly, most generally through
@@ -45,12 +65,14 @@ It's an interface that clients use indirectly, most generally through
by calling <code>{@link android.content.Context#getContentResolver
getContentResolver()}</code> from within the implementation of an Activity
or other application component:
+</p>
<pre>ContentResolver cr = getContentResolver();</pre>
<p>
You can then use the ContentResolver's methods to interact with whatever
content providers you're interested in.
+</p>
<p>
When a query is initiated, the Android system identifies the content provider
@@ -61,6 +83,7 @@ at all. Typically, there's just a single instance of each type of
ContentProvider. But it can communicate with multiple ContentResolver objects
in different applications and processes. The interaction between processes is
handled by the ContentResolver and ContentProvider classes.
+</p>
<h3>The data model</h3>
@@ -70,6 +93,7 @@ Content providers expose their data as a simple table on a database model,
where each row is a record and each column is data of a particular type
and meaning. For example, information about people and their phone numbers
might be exposed as follows:
+</p>
<table>
<tr>
@@ -119,6 +143,7 @@ Every record includes a numeric {@code _ID} field that uniquely identifies
the record within the table. IDs can be used to match records in related
tables &mdash; for example, to find a person's phone number in one table
and pictures of that person in another.
+</p>
<p>
A query returns a {@link android.database.Cursor} object that can move from
@@ -126,9 +151,10 @@ record to record and column to column to read the contents of each field.
It has specialized methods for reading each type of data. So, to read a field,
you must know what type of data the field contains. (There's more on query
results and Cursor objects later.)
+</p>
-<h3>URIs</h3><a name="uri"></a>
+<h3><a name="uri"></a>URIs</h3>
<p>
Each content provider exposes a public URI (wrapped as a {@link android.net.Uri}
@@ -136,6 +162,7 @@ object) that uniquely identifies its data set. A content provider that controls
multiple data sets (multiple tables) exposes a separate URI for each one. All
URIs for providers begin with the string "{@code content://}". The {@code content:}
scheme identifies the data as being controlled by a content provider.
+</p>
<p>
If you're defining a content provider, it's a good idea to also define a
@@ -144,38 +171,46 @@ Android defines {@code CONTENT_URI} constants for all the providers that come
with the platform. For example, the URI for the table that matches
phone numbers to people and the URI for the table that holds pictures of
people (both controlled by the Contacts content provider) are:
+</p>
<p>
-<dl><dd>{@code android.provider.Contacts.Phones.CONTENT_URI}
-<br/>{@code android.provider.Contacts.Photos.CONTENT_URI}</dd></dl>
+<p style="margin-left: 2em">{@code android.provider.Contacts.Phones.CONTENT_URI}
+<br/>{@code android.provider.Contacts.Photos.CONTENT_URI}
+</p>
<p>
Similarly, the URIs for the table of recent phone calls and the table
of calendar entries are:
+</p>
<p>
-<dl><dd>{@code android.provider.CallLog.Calls.CONTENT_URI}
-<br/>{@code android.provider.Calendar.CONTENT_URI}</dd></dl>
+<p style="margin-left: 2em">{@code android.provider.CallLog.Calls.CONTENT_URI}
+<br/>{@code android.provider.Calendar.CONTENT_URI}
+</p>
<p>
The URI constant is used in all interactions with the content provider.
Every {@link android.content.ContentResolver} method takes the URI
as its first argument. It's what identifies which provider the ContentResolver
should talk to and which table of the provider is being targeted.
+</p>
-<h2>Querying a Content Provider<a name="querying"></a></h2>
+<h2><a name="querying"></a>Querying a Content Provider</h2>
<p>
You need three pieces of information to query a content provider:
+</p>
+
<ul>
-<li>The URI that identifies the provider
-<li>The names of the data fields you want to receive
-<li>The data types for those fields
+<li>The URI that identifies the provider</li>
+<li>The names of the data fields you want to receive</li>
+<li>The data types for those fields</li>
</ul>
<p>
If you're querying a particular record, you also need the ID for that record.
+</p>
<h3>Making the query</h3>
@@ -193,20 +228,23 @@ and requerying itself when the activity restarts. You can ask an Activity to
begin managing an unmanaged Cursor object for you by calling
<code>{@link android.app.Activity#startManagingCursor
Activity.startManagingCursor()}</code>.
+</p>
<p>
The first argument to either <code>{@link android.content.ContentResolver#query query()}</code>
or <code>{@link android.app.Activity#managedQuery managedQuery()}</code> is the provider URI
&mdash; the {@code CONTENT_URI} constant that identifies a particular
ContentProvider and data set (see <a href="#uri">URIs</a> earlier).
+</p>
<p>
To restrict a query to just one record, you can append the {@code _ID} value for
that record to the URI &mdash; that is, place a string matching the ID as the
last segment of the path part of the URI. For example, if the ID is 23,
the URI would be:
+</p>
-<dl><dd>{@code content://. . . ./23}</dd></dl>
+<p style="margin-left: 2em">{@code content://. . . ./23}</p>
<p>
There are some helper methods, particularly
@@ -216,6 +254,7 @@ android.net.Uri#withAppendedPath Uri.withAppendedPath()}</code>,
that make it easy to append an ID to a URI. Both are static methods that return
a Uri object with the ID added. So, for example, if you were looking for record
23 in the database of people contacts, you might construct a query as follows:
+</p>
<pre>
import android.provider.Contacts.People;
@@ -238,32 +277,34 @@ Cursor cur = managedQuery(myPerson, null, null, null, null);
The other arguments to the <code>{@link android.content.ContentResolver#query query()}</code>
and <code>{@link android.app.Activity#managedQuery managedQuery()}</code> methods delimit
the query in more detail. They are:
+</p>
<ul>
-<p><li>The names of the data columns that should be returned. A {@code null}
+<li>The names of the data columns that should be returned. A {@code null}
value returns all columns. Otherwise, only columns that are listed by name
are returned. All the content providers that come with the platform define
constants for their columns. For example, the
{@link android.provider.Contacts.Phones android.provider.Contacts.Phones} class
defines constants for the names of the columns in the phone table illustrated
earlier &mdash {@code _ID}, {@code NUMBER}, {@code NUMBER_KEY}, {@code NAME},
-and so on.
+and so on.</li>
-<p><li>A filter detailing which rows to return, formatted as an SQL {@code WHERE}
+<li><p>A filter detailing which rows to return, formatted as an SQL {@code WHERE}
clause (excluding the {@code WHERE} itself). A {@code null} value returns
-all rows (unless the URI limits the query to a single record).
+all rows (unless the URI limits the query to a single record).</p></li>
-<p><li>Selection arguments.
+<li><p>Selection arguments.</p></li>
-<p><li>A sorting order for the rows that are returned, formatted as an SQL
-{@code ORDER BY} clause (excluding the {@code ORDER BY} itself). A {@code null} value
-returns the records in the default order for the table, which may be
-unordered.
+<li><p>A sorting order for the rows that are returned, formatted as an SQL
+{@code ORDER BY} clause (excluding the {@code ORDER BY} itself). A {@code null}
+value returns the records in the default order for the table, which may be
+unordered.</p></li>
</ul>
<p>
Let's look at an example query to retrieve a list of contact names and their
primary phone numbers:
+</p>
<pre>
import android.provider.Contacts.People;
@@ -294,6 +335,7 @@ This query retrieves data from the People table of the Contacts content
provider. It gets the name, primary phone number, and unique record ID for
each contact. It also reports the number of records that are returned as
the {@code _COUNT} field of each record.
+</p>
<p>
The constants for the names of the columns are defined in various interfaces
@@ -303,6 +345,7 @@ in {@link android.provider.Contacts.PhonesColumns PhoneColumns}. The
{@link android.provider.Contacts.People Contacts.People} class implements
each of these interfaces, which is why the code example above could refer
to them using just the class name.
+</p>
<h3>What a query returns</h3>
@@ -315,9 +358,11 @@ But every provider has an {@code _ID} column, which holds a unique numeric
ID for each record. Every provider can also report the number
of records returned as the {@code _COUNT} column; its value
is the same for all rows.
+</p>
<p>
Here is an example result set for the query in the previous section:
+</p>
<table border="1">
<tbody>
@@ -353,6 +398,7 @@ The retrieved data is exposed by a {@link android.database.Cursor Cursor}
object that can be used to iterate backward or forward through the result
set. You can use this object only to read the data. To add, modify, or
delete data, you must use a ContentResolver object.
+</p>
<h3>Reading retrieved data</h3>
@@ -372,10 +418,12 @@ android.database.Cursor#getFloat getFloat()}</code>.
the Cursor object will give you the String representation of the data.)
The Cursor lets you request the column name from the index of the column,
or the index number from the column name.
+</p>
<p>
The following snippet demonstrates reading names and phone numbers from
the query illustrated earlier:
+</p>
<pre>
import android.provider.Contacts.People;
@@ -411,7 +459,8 @@ In general, smaller amounts of data (say, from 20 to 50K or less) are most often
directly entered in the table and can be read by calling
<code>{@link android.database.Cursor#getBlob Cursor.getBlob()}</code>.
It returns a byte array.
-
+</p>
+
<p>
If the table entry is a {@code content:} URI, you should never try to open
and read the file directly (for one thing, permissions problems can make this
@@ -419,18 +468,20 @@ fail). Instead, you should call
<code>{@link android.content.ContentResolver#openInputStream
ContentResolver.openInputStream()}</code> to get an
{@link java.io.InputStream} object that you can use to read the data.
+</p>
-<h2>Modifying Data<a name="modifying"></a></h2>
+<h2><a name="modifying"></a>Modifying Data</h2>
<p>
Data kept by a content provider can be modified by:
+</p>
<ul>
-<p><li>Adding new records
-<li>Adding new values to existing records
-<li>Batch updating existing records
-<li>Deleting records
+<p><li>Adding new records</li>
+<li>Adding new values to existing records</li>
+<li>Batch updating existing records</li>
+<li>Deleting records</li>
</ul>
<p>
@@ -438,6 +489,7 @@ All data modification is accomplished using {@link android.content.ContentResolv
methods. Some content providers require a more restrictive permission for writing
data than they do for reading it. If you don't have permission to write to a
content provider, the ContentResolver methods will fail.
+</p>
<h3>Adding records</h3>
@@ -453,6 +505,7 @@ the full URI of the new record &mdash; that is, the provider's URI with
the appended ID for the new record. You can then use this URI to query and
get a Cursor over the new record, and to further modify the record.
Here's an example:
+</p>
<pre>
import android.provider.Contacts.People;
@@ -478,6 +531,7 @@ Once a record exists, you can add new information to it or modify
existing information. For example, the next step in the example above would
be to add contact information &mdash; like a phone number or an IM or e-mail
address &mdash; to the new entry.
+</p>
<p>
The best way to add to a record in the Contacts database is to append
@@ -487,6 +541,7 @@ Contacts table exposes a name for this purpose as a {@code
CONTENT_DIRECTORY} constant. The following code continues the previous
example by adding a phone number and e-mail address for the record
just created:
+</p>
<pre>
Uri phoneUri = null;
@@ -527,6 +582,7 @@ or a complete song, put a {@code content:} URI for the data in the table and cal
ContentResolver.openOutputStream()}</code>
with the file's URI. (That causes the content provider to store the data
in a file and record the file path in a hidden field of the record.)
+</p>
<p>
In this regard, the {@link android.provider.MediaStore} content
@@ -539,6 +595,7 @@ to get the data itself. Similarly, the same URI that is used with
{@code insert()} to put meta-information into a MediaStore record
is used with {@code openOutputStream()} to place the binary data there.
The following code snippet illustrates this convention:
+</p>
<pre>
import android.provider.MediaStore.Images.Media;
@@ -574,14 +631,16 @@ To batch update a group of records (for example, to change "NY" to "New York"
in all fields), call the <code>{@link
android.content.ContentResolver#update ContentResolver.update()}</code>
method with the columns and values to change.
+</p>
-<h3>Deleting a record <a name="deletingrecord"></a></h3>
+<h3><a name="deletingrecord"></a>Deleting a record</h3>
<p>
To delete a single record, call {<code>{@link
android.content.ContentResolver#delete ContentResolver.delete()}</code>
with the URI of a specific row.
+</p>
<p>
To delete multiple rows, call <code>{@link
@@ -590,30 +649,33 @@ with the URI of the type of record to delete (for example, {@code android.provid
clause defining which rows to delete. (<i><b>Caution</b>:
Be sure to include a valid {@code WHERE} clause if you're deleting a general
type, or you risk deleting more records than you intended!</i>).
+</p>
-<h2>Creating a Content Provider<a name="creating"></a></h2>
+<h2><a name="creating"></a>Creating a Content Provider</h2>
<p>
To create a content provider, you must:
+</p>
<ul>
-<p><li>Set up a system for storing the data. Most content providers
+<li>Set up a system for storing the data. Most content providers
store their data using Android's file storage methods or SQLite databases,
but you can store your data any way you want. Android provides the
{@link android.database.sqlite.SQLiteOpenHelper SQLiteOpenHelper}
class to help you create a database and {@link
-android.database.sqlite.SQLiteDatabase SQLiteDatabase} to manage it.
+android.database.sqlite.SQLiteDatabase SQLiteDatabase} to manage it.</li>
-<p><li>Extend the {@link android.content.ContentProvider} class to provide
-access to the data.
+<li><p>Extend the {@link android.content.ContentProvider} class to provide
+access to the data.</p></li>
-<p><li>Declare the content provider in the manifest file for your
-application (AndroidManifest.xml).
+<li><p>Declare the content provider in the manifest file for your
+application (AndroidManifest.xml).</p></li>
</ul>
<p>
The following sections have notes on the last two of these tasks.
+</p>
<h3>Extending the ContentProvider class</h3>
@@ -623,13 +685,14 @@ You define a {@link android.content.ContentProvider} subclass to
expose your data to others using the conventions expected by
ContentResolver and Cursor objects. Principally, this means
implementing six abstract methods declared in the ContentProvider class:
+</p>
-<dl><dd>{@code query()}
+<p style="margin-left: 2em">{@code query()}
<br/>{@code insert()}
<br/>{@code update()}
<br/>{@code delete()}
<br/>{@code getType()}
-<br/>{@code onCreate()}</dd></dl>
+<br/>{@code onCreate()}</p>
<p>
The {@code query()} method must return a {@link android.database.Cursor} object
@@ -639,19 +702,27 @@ Android provides some ready-made Cursor objects that you can use. For example,
an SQLite database. You get the Cursor object by calling any of the {@link
android.database.sqlite.SQLiteDatabase SQLiteDatabase} class's {@code query()}
methods. There are other Cursor implementations &mdash; such as {@link
-android.database.MatrixCursor} &mdash; for data not stored in a database.
+android.database.MatrixCursor} &mdash; for data not stored in a database.
+</p>
+
+<p>
+Because these ContentProvider methods can be called from
+various ContentResolver objects in different processes and threads,
+they must be implemented in a thread-safe manner.
+</p>
<p>
As a courtesy, you might also want to call <code>{@link android.content.ContentResolver#notifyChange(android.net.Uri,android.database.ContentObserver)
ContentResolver.notifyChange()}</code> to notify listeners when there are
modifications to the data.
+</p>
<p>
Beyond defining the subclass itself, there are other steps you should take
to simplify the work of clients and make the class more accessible:
+</p>
<ul>
-<p>
<li>Define a {@code public static final} {@link android.net.Uri}
named {@code CONTENT_URI}. This is the string that represents the full
{@code content:} URI that your content provider handles. You must define a
@@ -667,21 +738,23 @@ If the provider has subtables, also define {@code CONTENT_URI} constants for
each of the subtables. These URIs should all have the same authority (since
that identifies the content provider), and be distinguished only by their paths.
For example:
+</p>
-<dl><dd>{@code content://com.example.codelab.transporationprovider/train}
+<p style="margin-left: 2em">{@code content://com.example.codelab.transporationprovider/train}
<br/>{@code content://com.example.codelab.transporationprovider/air/domestic}
-<br/>{@code content://com.example.codelab.transporationprovider/air/international}</dd></dl>
+<br/>{@code content://com.example.codelab.transporationprovider/air/international}</p>
<p>
For an overview of {@code content:} URIs, see the <a href="#urisum">Content URI
Summary</a> at the end of this document.
+</p></li>
-<p>
-<li>Define the column names that the content provider will return to clients.
+<li><p>Define the column names that the content provider will return to clients.
If you are using an underlying database, these column names are typically
identical to the SQL database column names they represent. Also define
{@code public static} String constants that clients can use to specify
the columns in queries and other instructions.
+</p>
<p>
Be sure to include an integer column named "{@code _id}"
@@ -690,8 +763,9 @@ the IDs of the records. You should have this field whether or not you have
another field (such as a URL) that is also unique among all records. If
you're using the SQLite database, the {@code _ID} field should be the
following type:
+</p>
-<dl><dd>{@code INTEGER PRIMARY KEY AUTOINCREMENT}</dd></dl>
+<p style="margin-left: 2em">{@code INTEGER PRIMARY KEY AUTOINCREMENT}</p>
<p>
The {@code AUTOINCREMENT} descriptor is optional. But without it, SQLite
@@ -699,50 +773,42 @@ increments an ID counter field to the next number above the largest
existing number in the column. If you delete the last row, the next row added
will have the same ID as the deleted row. {@code AUTOINCREMENT} avoids this
by having SQLite increment to the next largest value whether deleted or not.
+</p>
+</li>
-<p>
-<li>Carefully document the data type of each column. Clients need this
-information to read the data.
+<li><p>Carefully document the data type of each column. Clients need this
+information to read the data.</p></li>
-<p>
-<li>If you are handling a new data type, you must define a new MIME type
+<li><p>If you are handling a new data type, you must define a new MIME type
to return in your implementation of <code>{@link
android.content.ContentProvider#getType ContentProvider.getType()}</code>.
The type depends in part on whether or not the {@code content:} URI submitted
to {@code getType()} limits the request to a specific record. There's one
form of the MIME type for a single record and another for multiple records.
Use the {@link android.net.Uri Uri} methods to help determine what is being
-requested. Here is the general format for each type:
+requested. Here is the general format for each type:</p></li>
<ul>
-<p><li>For a single record:
-
-<dl><dd>{@code vnd.android.cursor.item/vnd.<em>yourcompanyname.contenttype</em}</dd></dl>
-
-<p>For example, a request for train record 122 such as the following URI,
-
-<dl><dd>{@code content://com.example.transportationprovider/trains/122}</dd></dl>
+<li><p>For a single record:&nbsp;&nbsp;&nbsp; {@code vnd.android.cursor.item/vnd.<em>yourcompanyname.contenttype</em}</p>
-<p>might return this MIME type:
+<p>For example, a request for train record 122, like this URI,</p>
+<p style="margin-left: 2em">{@code content://com.example.transportationprovider/trains/122}</p>
-<dl><dd>{@code vnd.android.cursor.item/vnd.example.rail}</dd></dl>.
+<p>might return this MIME type:</p>
+<p style="margin-left: 2em">{@code vnd.android.cursor.item/vnd.example.rail}</p>
+</li>
-<p>
-<li>For multiple records:
-
-<dl><dd>{@code vnd.android.cursor.dir/vnd.<em>yourcompanyname.contenttype</em>}</dd></dl>
-
-<p>For example, a request for all train records like the following URI,
+<li><p>For multiple records:&nbsp;&nbsp;&nbsp; {@code vnd.android.cursor.dir/vnd.<em>yourcompanyname.contenttype</em>}</p>
-<dl><dd>{@code content://com.example.transportationprovider/trains}</dd></dl>
+<p>For example, a request for all train records, like the following URI,</p>
+<p style="margin-left: 2em">{@code content://com.example.transportationprovider/trains}</p>
-<p>might return this MIME type
-
-<dl><dd>{@code vnd.android.cursor.dir/vnd.example.rail}</dd></dl>
+<p>might return this MIME type:</p>
+<p style="margin-left: 2em">{@code vnd.android.cursor.dir/vnd.example.rail}</p>
+</li>
</ul>
-<p>
-<li>If you are exposing byte data that's too big to put in the table itself
+<li><p>If you are exposing byte data that's too big to put in the table itself
&mdash; such as a large bitmap file &mdash; the field that exposes the
data to clients should actually contain a {@code content:} URI string.
This is the field that gives clients access to the data file. The record
@@ -753,13 +819,14 @@ android.content.ContentResolver#openInputStream ContentResolver.openInputStream(
on the user-facing field holding the URI for the item. The ContentResolver
will request the "{@code _data}" field for that record, and because
it has higher permissions than a client, it should be able to access
-that file directly and return a read wrapper for the file to the client.
+that file directly and return a read wrapper for the file to the client.</p></li>
</ul>
<p>
For an example of a private content provider implementation, see the
-NodePadProvider class in the notepad sample application that ships with the SDK.
+NodePadProvider class in the Notepad sample application that ships with the SDK.
+</p>
<h3>Declaring the content provider</h3>
@@ -769,6 +836,7 @@ To let the Android system know about the content provider you've developed,
declare it with a {@code &lt;provider&gt;} element in the application's
AndroidManifest.xml file. Content providers that are not declared in the
manifest are not visible to the Android system
+</p>
<p>
The {@code name} attribute is the fully qualified name of the ContentProvider
@@ -776,6 +844,7 @@ subclass. The {@code authorities} attribute is the authority part of the
{@code content:} URI that identifies the provider.
For example if the ContentProvider subclass is AutoInfoProvider, the
{@code &lt;provider&gt;} element might look like this:
+</p>
<pre>
&lt;provider name="com.example.autos.AutoInfoProvider"
@@ -788,15 +857,17 @@ For example if the ContentProvider subclass is AutoInfoProvider, the
Note that the {@code authorities} attribute omits the path part of a
{@code content:} URI. For example, if AutoInfoProvider controlled subtables
for different types of autos or different manufacturers,
+</p>
-<dl><dd>{@code content://com.example.autos.autoinfoprovider/honda}
+<p style="margin-left: 2em">{@code content://com.example.autos.autoinfoprovider/honda}
<br/>{@code content://com.example.autos.autoinfoprovider/gm/compact}
-<br/>{@code content://com.example.autos.autoinfoprovider/gm/suv}</dd></dl>
+<br/>{@code content://com.example.autos.autoinfoprovider/gm/suv}</p>
<p>
-those paths would not be declared in the manifest. The authority
-identifies the provider; your provider can interpret the path part of the
-URI in any way you choose.
+those paths would not be declared in the manifest. The authority is what
+identifies the provider, not the path; your provider can interpret the path
+part of the URI in any way you choose.
+</p>
<p>
Other {@code &lt;provider&gt;} attributes can set permissions to read and
@@ -806,42 +877,46 @@ attribute to "{@code true}" if data does not need to be synchronized between
multiple running versions of the content provider. This permits an instance
of the provider to be created in each client process, eliminating the need
to perform IPC.
+</p>
-<h2>Content URI Summary</h2><a name="urisum"></a>
+<h2><a name="urisum"></a>Content URI Summary</h2>
<p>
Here is a recap of the important parts of a content URI:
+</p>
<p>
-<img src="../../images/content_uri.png" alt="Elements of a content URI"
+<img src="{@docRoot}images/content_uri.png" alt="Elements of a content URI"
height="80" width="528">
+</p>
<ol type="A">
-<p><li>Standard prefix indicating that the data is controlled by a
-content provider. It's never modified. </li>
+<li>Standard prefix indicating that the data is controlled by a
+content provider. It's never modified.</li>
-<p><li>The authority part of the URI; it identifies the content provider.
+<li><p>The authority part of the URI; it identifies the content provider.
For third-party applications, this should be a fully-qualified class name
(reduced to lowercase) to ensure uniqueness. The authority is declared in
-the {@code &lt;provider&gt;} element's {@code authorities} attribute:
+the {@code &lt;provider&gt;} element's {@code authorities} attribute:</p>
<pre>&lt;provider name=".TransportationProvider"
authorities="com.example.transportationprovider"
- . . . &gt;</pre>
+ . . . &gt;</pre></li>
-<p><li>The path that the content provider uses to determine what kind of data is
+<li><p>The path that the content provider uses to determine what kind of data is
being requested. This can be zero or more segments long. If the content provider
exposes only one type of data (only trains, for example), it can be absent.
If the provider exposes several types, including subtypes, it can be several
segments long &mdash; for example, "{@code land/bus}", "{@code land/train}",
-"{@code sea/ship}", and "{@code sea/submarine}" to give four possibilities.
+"{@code sea/ship}", and "{@code sea/submarine}" to give four possibilities.</p></li>
-<p><li>The ID of the specific record being requested, if any. This is the
+<li><p>The ID of the specific record being requested, if any. This is the
{@code _ID} value of the requested record. If the request is not limited to
-a single record, this segment and the trailing slash are omitted:
+a single record, this segment and the trailing slash are omitted:</p>
-<dl><dd>{@code content://com.example.transportationprovider/trains}</dd></dl>
+<p style="margin-left: 2em">{@code content://com.example.transportationprovider/trains}</p>
+</li>
</ol>
diff --git a/docs/html/guide/topics/resources/available-resources.jd b/docs/html/guide/topics/resources/available-resources.jd
index bfe360e..c59d3a8 100644
--- a/docs/html/guide/topics/resources/available-resources.jd
+++ b/docs/html/guide/topics/resources/available-resources.jd
@@ -1,45 +1,71 @@
page.title=Available Resource Types
+parent.title=Resources and Assets
+parent.link=index.html
@jd:body
-<p>This page describes the different types of resources that you can
-externalize from your code and package with your application. They fall into
-the following groups:</p>
-<ul>
- <li><a href="#simplevalues">Simple Values</a></li>
- <li><a href="#drawables">Drawables</a></li>
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.content.res.Resources}</li>
+ <li>{@link android.content.res.AssetManager}</li>
+ </ol>
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#simplevalues">Simple Values</a>
+ <ol>
+ <li><a href="#colorvals">Color Values</a></li>
+ <li><a href="#stringresources">Strings and Styled Text</a></li>
+ <li><a href="#dimension">Dimension Values</a></li>
+ </ol>
+ </li>
+ <li><a href="#drawables">Drawables</a>
+ <ol>
+ <li><a href="#imagefileresources">Bitmap Files</a></li>
+ <li><a href="#colordrawableresources">Color Drawables</a></li>
+ <li><a href="#ninepatch">Nine-Patch (Stretchable) Images</a></li>
+ </ol>
+ </li>
<li><a href="#animation">Animation</a></li>
- <li><a href="#layoutresources">Layout</a></li>
+ <li><a href="#layoutresources">Layout</a>
+ <ol>
+ <li><a href="#customresources">Custom Layout Resources</a>
+ </ol>
+ </li>
<li><a href="#stylesandthemes">Styles and Themes</a></li>
-</ul>
+ </ol>
+
+</div>
+</div>
+
+<p>This page describes the different types of resources that you can
+externalize from your code and package with your application. </p>
+
<p>For more details on how to use resources in your application, please see the
- <a href="{@docRoot}devel/resources-i18n.html">Resources and i18n</a>
+ <a href="resources-i18n.html">Resources and Internationalization</a>
documentation.</p>
-<a name="simplevalues" id="simplevalues"></a>
-<h2>Simple Values</h2>
+
+<h2 id="simplevalues">Simple Values</h2>
<p>All simple resource values can be expressed as a string, using various
formats to unambiguously indicate the type of resource being created. For
this reason, these values can be defined both as standard resources
-(under res/values), as well as direct values supplied for
+(under res/values/), as well as direct values supplied for
mappings in <a href="#stylesandthemes">styles and themes</a>, and attributes in
XML files such as <a href="#layoutresources">layouts</a>.</p>
-<ul>
- <li><a href="#colorvals">Colors</a></li>
- <li><a href="#stringresources">Strings and Styled Text</a></li>
- <li><a href="#dimension">Dimensions</a></li>
-</ul>
-<a name="colorvals" id="colorvals"></a>
-<h3>Color Values</h3>
+<h3 id="colorvals">Color Values</h3>
<p>
A color value specifies an RGB value with an alpha channel, which can
- be used in various places such as specifying a solid color for a Drawable
+ be used in various places such as specifying a solid color for a {@link android.graphics.drawable.Drawable}
or the color to use for text. A color value always begins with
- a '#' character and then is followed by the alpha-red-green-blue information
+ a pound (#) character and then followed by the Alpha-Red-Green-Blue information
in one of the following formats:
</p>
<ul>
@@ -128,8 +154,9 @@ int color = getResources.getColor(R.color.opaque_red);
android:text="Some Text"/&gt;
</pre>
-<a name="stringresources" id="stringresources"></a>
-<h3>Strings and Styled Text</h3>
+
+
+<h3 id="stringresources">Strings and Styled Text</h3>
<p>
Strings, with optional <a href="#styledtext">simple formatting</a>, can be
stored and retrieved as resources. You can add formatting to your string by
@@ -227,8 +254,8 @@ tv.setText(str);
android:text="@string/simple_welcome_message"/&gt;
</pre>
-<a name="styledtext" id="styledtext"></a>
-<h4>Using Styled Text as a Format String</h4>
+
+<h4 id="styledtext">Using Styled Text as a Format String</h4>
<p>
Sometimes you may want to create a styled text resource that is also used as a
format string. This cannot be done directly because there is no way of passing
@@ -268,8 +295,8 @@ CharSequence styledResults = Html.fromHtml(resultsText);
</li>
</ol>
-<a name="dimension" id="dimension"></a>
-<h3>Dimension Values</h3>
+
+<h3 id="dimension"Dimension Values</h3>
<p>You can create common dimensions to use for various screen elements by
defining dimension values in XML. A dimension resource is a number followed by
a unit of measurement. For example: 10px, 2in, 5sp. Here are the units of
@@ -376,22 +403,17 @@ float dimen = Resources.getDimen(R.dimen.one_pixel);
android:textSize="@dimen/sixteen_sp"/&gt;
</pre>
-<a name="drawables" id="drawables"></a>
-<h2>Drawables</h2>
+
+<h2 id="drawables">Drawables</h2>
<p>A {@link android.graphics.drawable.Drawable} is a type of resource that
you retrieve with {@link android.content.res.Resources#getDrawable
Resources.getDrawable()} and use to draw to the screen. There are a
number of drawable resources that can be created.</p>
-<ul>
- <li><a href="#imagefileresources">Bitmap Drawables</a></li>
- <li><a href="#colordrawableresources">Color Drawables</a></li>
- <li><a href="#ninepatch">Nine Patch (Stretchable) Drawables</a></li>
-</ul>
-<a name="imagefileresources" id="imagefileresources"></a>
-<h3>Bitmap files</h3>
+
+<h3 id="imagefileresources">Bitmap Files</h3>
<p>Android supports bitmap resource files in a few different formats: png
(preferred), jpg (acceptable), gif (discouraged). The bitmap file itself is
compiled and referenced by the file name without the extension (so
@@ -417,46 +439,11 @@ res/drawable/my_picture.png would be referenced as R.drawable.my_picture).</p>
<strong>XML</strong> <code>@[<em>package</em>:]drawable/<em>some_file</em></code>
</li>
</ul>
-<p>
- <strong>Example Code Use</strong>
-</p>
-<p>
- The following Java snippet demonstrates loading an {@link android.widget.ImageView ImageView} object with a single bitmap from a list of bitmap resources. ImageView is a basic display rectangle for graphics (animations or still images).
-</p>
-<pre>
-// Load an array with BitmapDrawable resources.
-private Integer[] mThumbIds = {
- R.drawable.sample_thumb_0,
- R.drawable.sample_thumb_1,
- R.drawable.sample_thumb_2,
- R.drawable.sample_thumb_3,
- R.drawable.sample_thumb_4
-};
-
-// Load and return a view with an image.
-public View getView(int position, ViewGroup parent)
-{
- ImageView i = new ImageView(mContext);
- i.setImageResource(mThumbIds[position]);
- i.setAdjustViewBounds(true);
- i.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
- i.setBackground(android.R.drawable.picture_frame);
- return i;
-}
-</pre>
-<p>
- This XML example demonstrates loading a bitmap file (chat_icon.png) in an ImageView.
-</p>
-<pre>
-&lt;ImageView id="@+id/icon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:tint="#FF000000"
- android:src="@drawable/chat_icon"/&gt;
-</pre>
-<a name="colordrawableresources" id="colordrawableresources"></a>
-<h3>Color Drawables</h3>
+<p>For more discussion and examples using drawable resources, see the discussion in <a href="{@docRoot}guide/topics/graphics/2d-graphics.html#drawable-resource#drawables">2D Graphics</a>.</p>
+
+
+<h3 id="colordrawableresources">Color Drawables</h3>
<p>You can create a {@link android.graphics.drawable.PaintDrawable} object that is a rectangle of color,
with optionally rounded corners. This element can be defined in any of the
files inside res/values/.</p>
@@ -465,7 +452,7 @@ version="1.0" encoding="utf-8"?&gt;</code> declaration, and a root
<code>&lt;resources&gt;</code> element containing one or more
<code>&lt;drawable&gt;</code> tags.</p>
<p>
- <strong>Resource source file location</strong>: res/values/colors.xml (File name is arbitrary; standard practice is to put the PaintDrawable items in the file along with the <a href="{@docRoot}devel/resources-i18n.html#numericcolorresources">numeric color values</a>.)
+ <strong>Resource source file location</strong>: res/values/colors.xml (File name is arbitrary; standard practice is to put the PaintDrawable items in the file along with the <a href="resources-i18n.html#numericcolorresources">numeric color values</a>.)
</p>
<p>
<strong>Compiled resource datatype:</strong> Resource pointer to a {@link android.graphics.drawable.PaintDrawable}.
@@ -536,8 +523,8 @@ tv.setBackground(redDrawable);
android:background="@drawable/solid_red"/&gt;
</pre>
-<a name="ninepatch" id="ninepatch"></a>
-<h3>Nine-Patch Stretchable Image</h3>
+
+<h3 id="ninepatch">Nine-Patch (stretchable) Images</h3>
<p>
Android supports a stretchable bitmap image, called a
{@link android.graphics.NinePatch} graphic. This is a PNG image in which
@@ -547,40 +534,7 @@ tv.setBackground(redDrawable);
of a stretchable image is the button backgrounds that Android uses; buttons
must stretch to accommodate strings of various lengths.
</p>
-<p>
- A NinePatch drawing is a standard PNG image that includes a 1 pixel wide
- border. This border is used to define the stretchable and static areas of
- the screen. You indicate a stretchable section by drawing one or more 1 pixel
- wide black lines in the left or top part of this border. You can have as
- many stretchable sections as you want. The relative size of the stretchable
- sections stays the same, so the largest sections always remain the largest.
-</p>
-<p>
- You can also define an optional drawable section of the image (effectively,
- the padding lines) by drawing a line on the right and bottom lines. If you
- do not draw these lines, the first top and left lines will be used.
-</p>
-<p>
- If a View object sets this graphic as a background and then specifies the
- View object's text, it will stretch itself so that all the text fits inside
- the area designated by the right and bottom lines (if included). If the
- padding lines are not included, Android uses the left and top lines to
- define the writeable area.
-</p>
-<p>The <a href="{@docRoot}reference/draw9patch.html">Draw 9-patch</a> tool offers
- an extremely handy way to create your NinePatch images, using a
- WYSIWYG graphics editor.
-</p>
-<p>
- Here is a sample NinePatch file used to define a button.
-</p>
-<p>
- <img src="{@docRoot}images/ninepatch_raw.png" alt="Raw ninepatch file
- showing the definition lines">
-</p>
-<p>
- This ninepatch uses one single stretchable area, and it also defines a drawable area.
-</p>
+
<p>
<strong>Source file format:</strong> PNG &mdash; one resource per file
</p>
@@ -601,44 +555,16 @@ tv.setBackground(redDrawable);
<strong>XML</strong> <code>@[<em>package</em>:]drawable.<em>some_file</em></code>
</li>
</ul>
-<p>
- <strong>Example XML Code</strong>
-</p>
-<p>
- Note that the width and height are set to "wrap_content" to make the button fit neatly around the text.
-</p>
-<pre>
-&lt;Button id="@+id/tiny"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_centerInParent="true"
- android:text="Tiny"
- android:textSize="8sp"
- android:background="@drawable/my_button_background"/&gt;
-
-&lt;Button id="@+id/big"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_centerInParent="true"
- android:text="Biiiiiiig text!"
- android:textSize="30sp"
- android:background="@drawable/my_button_background"/&gt;
-</pre>
-<p>
- Here are the two buttons based on this XML and the NinePatch graphic shown above. Notice how the width and height of the button varies with the text, and the background image stretches to accommodate it.
-</p>
-<p>
- <img src="{@docRoot}images/ninepatch_examples.png" alt="Two buttons based on the NinePatch button background">
-</p>
-<a name="animation" id="animation"></a>
-<h2>Animation</h2>
-<a name="tweenedanimation" id="tweenedanimation"></a>
-<h3>
- Tweened Animation
-</h3>
+
+<p>For more information and examples using NinePatch drawables, see the discussion
+in <a href="{@docRoot}guide/topics/graphics/2d-graphics.html#nine-patch">2D Graphics</a>.</p>
+
+
+
+<h2 id="animation">Animation</h2>
+
+<h3 id="tweenedanimation">Tweened Animation</h3>
<p>
Android can perform simple animation on a graphic, or a series of graphics. These include rotations, fading, moving, and stretching.
</p>
@@ -666,7 +592,7 @@ tv.setBackground(redDrawable);
<strong>Syntax</strong>
</p>
<p>
- The file must have a single root element: this will be either a single <code>&lt;alpha&gt;</code>, <code>&lt;scale&gt;</code>, <code>&lt;translate&gt;</code>, <code>&lt;rotate&gt;</code>, interpolator element, or <code>&lt;set&gt;</code> element that holds groups of these elements (which may include another <code>&lt;set&gt;</code>). By default, all elements are applied simultaneously. To have them occur sequentially, you must specify the <code>startOffset</code> attribute, as shown in the example code.
+ The file must have a single root element: this will be either a single <code>&lt;alpha&gt;</code>, <code>&lt;scale&gt;</code>, <code>&lt;translate&gt;</code>, <code>&lt;rotate&gt;</code>, interpolator element, or <code>&lt;set&gt;</code> element that holds groups of these elements (which may include another <code>&lt;set&gt;</code>). By default, all elements are applied simultaneously. To have them occur sequentially, you must specify the <code>startOffset</code> attribute.
</p>
<pre>
&lt;set android:shareInterpolator=boolean&gt; // Only required if multiple tags are used.
@@ -677,15 +603,15 @@ tv.setBackground(redDrawable);
android:fromYScale=float
android:toYScale=float
android:pivotX=string
- android:pivotY=string&gt; |
+ android:pivotY=string &gt; |
&lt;translate android:fromX=string
android:toX=string
android:fromY=string
- android:toY=string&gt; |
+ android:toY=string &gt; |
&lt;rotate android:fromDegrees=float
android:toDegrees=float
android:pivotX=string
- android:pivotY=string /&gt; |
+ android:pivotY=string &gt; |
&lt;<em>interpolator tag</em>&gt;
&lt;set&gt;
&lt;/set&gt;
@@ -828,71 +754,41 @@ Supports the following attributes in any of the following three formats: values
You can optionally set an interpolator for each element to determine how quickly or slowly it performs its effect over time. For example, slow at the beginning and faster at the end for EaseInInterpolator, and the reverse for EaseOutInterpolator. A list of interpolators is given in {@link android.R.anim}. To specify these, use the syntax @android:anim/<em>interpolatorName</em>.
</dd>
</dl>
-<p>
- <strong>Example XML Declaration</strong>
-</p>
-<p>
- The following XML from the ApiDemos application is used to stretch, then simultaneously spin and rotate a block of text.
-</p>
-<pre>
-&lt;set android:shareInterpolator="false"&gt;
- &lt;scale
- android:interpolator="&#64;android:anim/ease_in_out_interpolator"
- android:fromXScale="1.0"
- android:toXScale="1.4"
- android:fromYScale="1.0"
- android:toYScale="0.6"
- android:pivotX="50%"
- android:pivotY="50%"
- android:fillAfter="false"
- android:duration="700" /&gt;
- &lt;set android:interpolator="&#64;android:anim/ease_in_interpolator"&gt;
- &lt;scale
- android:fromXScale="1.4"
- android:toXScale="0.0"
- android:fromYScale="0.6"
- android:toYScale="0.0"
- android:pivotX="50%"
- android:pivotY="50%"
- android:startOffset="700"
- android:duration="400"
- android:fillBefore="false" /&gt;
- &lt;rotate
- android:fromDegrees="0"
- android:toDegrees="-45"
- android:toYScale="0.0"
- android:pivotX="50%"
- android:pivotY="50%"
- android:startOffset="700"
- android:duration="400" /&gt;
- &lt;/set&gt;
-&lt;/set&gt;
-</pre>
-<p>
- The following Java code loads animations called res/anim/hyperspace_in.xml and res/anim/hyperspace_out.xml into a {@link android.widget.ViewFlipper}.
-</p>
-<pre>
-mFlipper.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.hyperspace_in));
-mFlipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.hyperspace_out));
-</pre>
-<a name="layoutresources" id="layoutresources"></a>
-<h2>Layout</h2>
-<p>
- Android lets you specify screen layouts using XML elements inside an XML file, similar to designing screen layout for a webpage in an HTML file. Each file contains a whole screen or a part of a screen, and is compiled into a View resource that can be passed in to {@link android.app.Activity#setContentView(int) Activity.setContentView} or used as a reference by other layout resource elements. Files are saved in the res/layout/ folder of your project, and compiled by the Android resource compiler aapt.
-</p>
-<p>
- Every layout XML file must evaluate to a single root element. First we'll describe how to use the standard XML tags understood by Android as it is shipped, and then we'll give a little information on how you can define your own custom XML elements for custom View objects. See <a href="{@docRoot}devel/implementing-ui.html">Implementing a User Interface</a> for details about the visual elements that make up a screen.
-</p>
-<p>
- The root element must have the Android namespace "http://schemas.android.com/apk/res/android" defined in the root element
-</p>
-<p>
- <strong>Source file format:</strong> XML file requiring a <code>&lt;?xml version="1.0" encoding="utf-8"?&gt;</code> declaration, and a root element of one of the supported XML layout elements.
-</p>
-<p>
- <strong>Resource file location</strong>: res/layout/<em>some_file</em>.xml.
-</p>
+<p>For animation code samples, see the discussion in the
+<a href="{@docRoot}guide/topics/graphics/2d-graphics.html">2D Graphics</a> topic.</p>
+
+
+<h2 id="layoutresources">Layout</h2>
+<p>Android lets you specify screen layouts using XML elements inside an XML
+file, similar to designing screen layout for a webpage in an HTML file. Each
+file contains a whole screen or a part of a screen, and is compiled into a
+View resource that can be passed in to
+{@link android.app.Activity#setContentView(int) Activity.setContentView} or used as a
+reference by other layout resource elements. Files are saved in the
+<code>res/layout/</code> folder of your project, and compiled by the Android resource
+compiler, aapt. </p>
+
+<p> Every layout XML file must evaluate to a single root
+element. First we'll describe how to use the standard XML tags understood by
+Android as it is shipped, and then we'll give a little information on how you
+can define your own custom XML elements for custom View objects.
+
+<p> The root element must have
+the Android namespace "http://schemas.android.com/apk/res/android" defined in
+the root element.</p>
+
+<p>For a complete discussion on creating layouts, see the
+<a href="{@docRoot}guide/topics/views/index.html">Views and Layout</a> topic.</p>
+
+<p> <strong>Source file format:</strong> XML file
+requiring a <code>&lt;?xml version="1.0" encoding="utf-8"?&gt;</code>
+declaration, and a root element of one of the supported XML layout elements.
+</p>
+
+
+<p><strong>Resource file location</strong>:
+res/layout/<em>some_file</em>.xml.</p>
<p>
<strong>Compiled resource datatype:</strong> Resource pointer to a {@link android.view.View} (or subclass) resource.
</p>
@@ -977,7 +873,7 @@ mFlipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.hyperspace_ou
<strong>Attributes exposed by all the superclasses of that element.</strong> For example, the TextView class extends the View class, so the <code>&lt;TextView&gt;</code> element supports all the attributes that the <code>&lt;View&gt;</code> element exposes &mdash; a long list, including <code>View_paddingBottom</code> and <code>View_scrollbars</code>. These too are used without the class name: <code>&lt;TextView android:paddingBottom="20" android:scrollbars="horizontal" /&gt;</code>.
</li>
<li>
- <strong>Attributes of the object's {@link android.view.ViewGroup.LayoutParams} subclass.</strong> All View objects support a LayoutParams member (see <a href="{@docRoot}devel/ui/layout.html">LayoutParams in Implementing a UI</a>). To set properties on an element's LayoutParams member, the attribute to use is "android:layout_<em>layoutParamsProperty</em>". For example: <code>android:layout_gravity</code> for an object wrapped by a <code>&lt;LinearLayout&gt;</code> element. Remember that each LayoutParams subclass also supports inherited attributes. Attributes exposed by each subclass are given in the format <em>someLayoutParamsSubclass</em>_Layout_layout_<em>someproperty</em>. This defines an attribute "android:layout_<em>someproperty</em>". Here is an example of how Android documentation lists the properties of the {@link android.widget.LinearLayout.LayoutParams LinearLayout.LayoutParams} class:
+ <strong>Attributes of the object's {@link android.view.ViewGroup.LayoutParams} subclass.</strong> All View objects support a LayoutParams member (see <a href="{@docRoot}guide/topics/views/layout.html">LayoutParams in Implementing a UI</a>). To set properties on an element's LayoutParams member, the attribute to use is "android:layout_<em>layoutParamsProperty</em>". For example: <code>android:layout_gravity</code> for an object wrapped by a <code>&lt;LinearLayout&gt;</code> element. Remember that each LayoutParams subclass also supports inherited attributes. Attributes exposed by each subclass are given in the format <em>someLayoutParamsSubclass</em>_Layout_layout_<em>someproperty</em>. This defines an attribute "android:layout_<em>someproperty</em>". Here is an example of how Android documentation lists the properties of the {@link android.widget.LinearLayout.LayoutParams LinearLayout.LayoutParams} class:
</li>
</ul>
<ul>
@@ -1037,8 +933,12 @@ setContentView(R.layout.main_screen);
<p>
However, layout elements can also represent repeating elements used as templates.
</p>
-<a name="customresources" id="customresources"></a>
-<h3>Custom Layout Resources</h3>
+
+<p>Also see <a href="{@docRoot}guide/topics/views/index.html">Views and Layout</a> for more information on layouts.</p>
+
+
+
+<h3 id="customresources">Custom Layout Resources</h3>
<p>
You can define custom elements to use in layout resources. These custom elements can then be used the same as any Android layout elements: that is, you can use them and specify their attributes in other resources. The ApiDemos sample application has an example of creating a custom layout XML tag, LabelView. To create a custom element, you will need the following files:
</p>
@@ -1066,8 +966,9 @@ setContentView(R.layout.main_screen);
<strong>Resource reference name:</strong> R.styleable.<em>some_file</em> (Java).
</p>
-<a name="stylesandthemes" id="stylesandthemes"></a>
-<h2>Styles and Themes</h2>
+
+
+<h2 id="stylesandthemes">Styles and Themes</h2>
<p>
A <em>style</em> is one or more attributes applied to a single element (for example, 10 point red Arial font, applied to a TextView). A style is applied as an attribute to an element in a layout XML file.
</p>
@@ -1075,8 +976,12 @@ setContentView(R.layout.main_screen);
A <em>theme</em> is one or more attributes applied to a whole screen &mdash; for example, you might apply the stock Android Theme.dialog theme to an activity designed to be a floating dialog box. A theme is assigned as an attribute to an Activity in the manifest file.
</p>
<p>
- Both styles and themes are defined in a &lt;style&gt; block containing one or more string or numerical values (typically color values), or references to other resources (drawables and so on). These elements support inheritance, so you could have MyBaseTheme, MyBaseTheme.Fancy, MyBaseTheme.Small, and so on.
+ Both styles and themes are defined in a <code>&lt;style&gt;</code> block containing one or more string or numerical values (typically color values), or references to other resources (drawables and so on). These elements support inheritance, so you could have MyBaseTheme, MyBaseTheme.Fancy, MyBaseTheme.Small, and so on.
</p>
+
+<p>For a complete discussion on styles and themes, read
+<a href="{@docRoot}guide/topics/views/themes.html">Applying Styles and Themes</a>.</p>
+
<p>
<strong>Source file format:</strong> XML file requiring a <code>&lt;?xml version="1.0" encoding="utf-8"?&gt;</code> declaration, and a root <code>&lt;resources&gt;</code> element containing one or more <code>&lt;style&gt;</code> tags.
</p>
@@ -1127,85 +1032,6 @@ setContentView(R.layout.main_screen);
A value to use in this theme. It can be a standard string, a hex color value, or a reference to any other resource type.
</dd>
</dl>
-<p>
- <strong>Example: Declaring a Style in XML</strong>
-</p>
-<pre>
-&lt;?xml version="1.0" encoding="utf-8"?&gt;
-&lt;resources&gt;
- &lt;style name="SpecialText"&gt;
- &lt;item name="android:textSize"&gt;18sp&lt;/item&gt;
- &lt;item name="android:textColor"&gt;#008&lt;/item&gt;
- &lt;/style&gt;
-&lt;/resources&gt;
-</pre>
-<p>
- <strong>Example: Referencing a Declared Style from an XML Resource</strong>
-</p>
-<p>
- The following layout XML file applies the previously defined style to a single text box.
-</p>
-<pre>
-&lt;!-- MainPageLayout.xml --&gt;
-&lt;?xml version="1.0" encoding="utf-8"?&gt;
-&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="fill_parent"
- android:layout_width="fill_parent"
- android:orientation="vertical"
- android:scrollbars="vertical"
- id="main_frame"&gt;
- &lt;EditText id="@+id/text1"
- style="@style/SpecialText"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Hello, World!" /&gt;
-&lt;/LinearLayout&gt;
-</pre>
-
-<p>
- <strong>Example XML Declaration of a Theme</strong>
-</p>
-<p>
- The following example defines a theme, "ThemeNew," which creates new theme items,
- refers to some previously defined theme items (values beginning with '@'),
- and refers to package resources (values beginning with '?').
-</p>
-<pre>
-&lt;style name="ThemeNew"&gt;
- &lt;item name="windowFrame"&gt;@drawable/screen_frame&lt;/item&gt;
- &lt;item name="windowBackground"&gt;@drawable/screen_background_white&lt;/item&gt;
- &lt;item name="panelForegroundColor"&gt;#FF000000&lt;/item&gt;
- &lt;item name="panelBackgroundColor"&gt;#FFFFFFFF&lt;/item&gt;
- &lt;item name="panelTextColor"&gt;?panelForegroundColor&lt;/item&gt;
- &lt;item name="panelTextSize"&gt;14&lt;/item&gt;
- &lt;item name="menuItemTextColor"&gt;?panelTextColor&lt;/item&gt;
- &lt;item name="menuItemTextSize"&gt;?panelTextSize&lt;/item&gt;
-&lt;/style&gt;
-</pre>
-<p>
- Notice that, to reference a value from the currently loaded theme, we use
- a question-mark (?) instead of the at-symbol (@), in the reference string.
- You must refer to such a specific <code>&lt;item&gt;</code> by its name in
- the currently loaded theme. This can be used in XML resources only.
-</p>
-
-<p>
- <strong>Example Code Use of a Theme</strong>
-</p>
-<p>
- The following Java snippet demonstrates loading a style set (i.e., a theme).
-</p>
-<pre>
-setTheme(R.style.ThemeNew);
-</pre>
-<p>
- The following XML applies an Android theme to a whole file (in this case, the Android dialog theme, to make the screen a floating dialog screen).
-</p>
-<pre>
-&lt;!-- AndroidManifest.xml --&gt;
-&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.codelab.rssexample"&gt;
- &lt;activity class="AddRssItem" android:label="@string/add_item_label" android:theme="@android:style/Theme.Dialog"/&gt;
-&lt;/manifest&gt;
-</pre>
+<p>For examples of how to declare and apply styles and themes, read
+<a href="{@docRoot}guide/topics/views/themes.html">Applying Styles and Themes</a>.</p>
diff --git a/docs/html/guide/topics/resources/index.jd b/docs/html/guide/topics/resources/index.jd
new file mode 100644
index 0000000..7e3bce42
--- /dev/null
+++ b/docs/html/guide/topics/resources/index.jd
@@ -0,0 +1,40 @@
+page.title=Resources and Assets
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.content.res.Resources}</li>
+ <li>{@link android.content.res.AssetManager}</li>
+ </ol>
+
+</div>
+</div>
+
+<p>Resources are an integral part of an Android application.
+In general, these are external elements that you want to include and reference within your application,
+like images, audio, video, text strings, layouts, themes, etc. Every Android application contains
+a directory for resources (<code>res/</code>) and a directory for assets (<code>assets/</code>).
+Assets are used less often, because their applications are far fewer. You only need to save data
+as an asset when you need to read the raw bites.
+The directories for resources and assets both reside at the top of your project directory, alongside your source code directory
+(<code>src/</code>).</p>
+
+<p>The difference between "resources" and "assets" isn't much on the surface, but in general,
+you'll use resources to store your external content much more often than you'll use assets.
+The real difference is that anything
+placed in the resources directory will be easily accessible from your application from the
+<code>R</code> class, which is compiled by Android. Whereas, anything placed in the assets
+directory will maintain its raw file format and, in order to read it, you must use the
+{@link android.content.res.AssetManager} to read the file as a stream of bytes. So keeping
+files and data in resources (<code>res/</code>) makes them easily accessible.</p>
+
+<p>Within the documents of this topic, you'll find information on the kinds of standard resources
+that are typically used in an Android application and how to reference them from you code.
+<a href="{@docRoot}guide/topics/resources/resources-i18n.html">Resources and Internationalization</a>
+is where you should start, to learn more about how Android utilizes project resources. Then, the
+<a href="{@docRoot}guide/topics/resources/available-resources.html">Available Resource Types</a>
+document offers a summary of various resource types and a reference to their specifications.
+</p>
diff --git a/docs/html/guide/topics/resources/resources-i18n.jd b/docs/html/guide/topics/resources/resources-i18n.jd
index d3ddd23..8a9bd43 100755..100644
--- a/docs/html/guide/topics/resources/resources-i18n.jd
+++ b/docs/html/guide/topics/resources/resources-i18n.jd
@@ -1,6 +1,34 @@
-page.title=Resources and i18n
+page.title=Resources and Internationalization
+parent.title=Resources and Assets
+parent.link=index.html
@jd:body
-<h1>Resources and Internationalization</h1>
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>Key classes</h2>
+ <ol>
+ <li>{@link android.content.res.Resources}</li>
+ </ol>
+
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#intro">Introduction</a></li>
+ <li><a href="#CreatingResources">Creating Resources</a></li>
+ <li><a href="#UsingResources">Using Resources</a>
+ <ol>
+ <li><a href="#ResourcesInCode">Using Resources in Code</a></li>
+ <li><a href="#ReferencesToResources">References to Resources</a></li>
+ <li><a href="#ReferencesToThemeAttributes">References to Theme Attributes</a></li>
+ <li><a href="#UsingSystemResources">Using System Resources</a></li>
+ </ol>
+ </li>
+ <li><a href="#AlternateResources">Alternate Resources</a></li>
+ <li><a href="#ResourcesTerminology">Terminology</a></li>
+ <li><a href="#i18n">Internationalization (I18N)</a></li>
+ </ol>
+</div>
+</div>
<p>Resources are external files (that is, non-code files) that are used by
your code and compiled into your application at build time. Android
@@ -13,41 +41,19 @@ a binary, fast loading format for efficiency reasons. Strings, likewise are comp
into a more efficient storage form. It is for these reasons that we have these
different resource types in the Android platform.</p>
-<p>This document contains the following sections:</p>
-
-<ul>
- <li> <a href="#Resources">Resources</a>
- <ul>
- <li> <a href="#CreatingResources">Creating Resources</a></li>
- <li> <a href="#UsingResources">Using Resources</a>
- <ul>
- <li><a href="#ResourcesInCode">Using Resources in Code</a></li>
- <li> <a href="#ReferencesToResources">References to Resources</a></li>
- <li> <a href="#ReferencesToThemeAttributes">References to Theme Attributes</a></li>
- <li> <a href="#UsingSystemResources">Using System Resources</a></li>
- </ul>
- </li>
- <li><a href="#AlternateResources">Alternate Resources</a></li>
- <li><a href="{@docRoot}reference/available-resources.html">
- Resource Reference</a></li>
- <li> <a href="#ResourcesTerminology">Terminology</a></li>
- </ul>
- </li>
- <li><a href="#i18n">Internationalization (I18N)</a></li>
-</ul>
<p>This is a fairly technically dense document, and together with the
-<a href="{@docRoot}reference/available-resources.html">Resource Reference</a>
+<a href="available-resources.html">Available Resources</a>
document, they cover a lot of information about resources. It is not necessary
to know this document by heart to use Android, but rather to know that the
information is here when you need it.</p>
-<a name="Resources"></a>
-<h2>Resources</h2>
+<a name="intro"></a>
+<h2>Introduction</h2>
<p>This topic includes a terminology list associated with resources, and a series
of examples of using resources in code. For a complete guide to the supported
Android resource types, see
- <a href="{@docRoot}reference/available-resources.html">Resources</a>.
+ <a href="available-resources.html">Available Resources</a>.
</p>
<p>The Android resource system keeps track of all non-code
assets associated with an application. You use the
@@ -84,7 +90,7 @@ subdirectory under the <code>res/</code> directory in your project. Android
has a resource compiler (aapt) that compiles resources according to which
subfolder they are in, and the format of the file. Here is a list of the file
types for each resource. See the
-<a href="{@docRoot}reference/available-resources.html">resource reference</a> for
+<a href="available-resources.html">Available Resources</a> for
descriptions of each type of object, the syntax, and the format or syntax of
the containing file.</p>
@@ -96,9 +102,9 @@ the containing file.</p>
<tr>
<td><code>res/anim/</code></td>
<td>XML files that are compiled into
- <a href="{@docRoot}reference/available-resources.html#animationdrawable">frame by
+ <a href="available-resources.html#animationdrawable">frame by
frame animation</a> or
- <a href="{@docRoot}reference/available-resources.html#tweenedanimation">tweened
+ <a href="available-resources.html#tweenedanimation">tweened
animation</a> objects </td>
</tr>
<tr>
@@ -107,14 +113,14 @@ the containing file.</p>
Drawable resource subtypes:</p>
<p>To get a resource of this type, use <code>Resource.getDrawable(<em>id</em>)</code>
<ul>
- <li><a href="{@docRoot}reference/available-resources.html#imagefileresources">bitmap files</a></li>
- <li><a href="{@docRoot}reference/available-resources.html#ninepatch">9-patches (resizable bitmaps)</a></li>
+ <li><a href="available-resources.html#imagefileresources">bitmap files</a></li>
+ <li><a href="available-resources.html#ninepatch">9-patches (resizable bitmaps)</a></li>
</ul></td>
</tr>
<tr>
<td><code>res/layout/</code></td>
<td>XML files that are compiled into screen layouts (or part of a screen).
- See <a href="{@docRoot}devel/ui/xml.html">layouts</a></td>
+ See <a href="{@docRoot}guide/topics/views/declaring-layout.html">Declaring Layout</a></td>
</tr>
<tr>
<td><code>res/values/</code></td>
@@ -129,19 +135,19 @@ the containing file.</p>
<ul>
<li><strong>arrays.xml</strong> to define arrays </li>
<!-- TODO: add section on arrays -->
- <li><strong>colors.xml</strong> to define <a href="{@docRoot}reference/available-resources.html#colordrawableresources">color
+ <li><strong>colors.xml</strong> to define <a href="available-resources.html#colordrawableresources">color
drawables</a> and <a href="#colorvals">color string values</a>.
Use <code>Resources.getDrawable()</code> and
<code>Resources.getColor(), respectively,</code>
to get these resources.</li>
- <li><strong>dimens.xml</strong> to define <a href="{@docRoot}reference/available-resources.html#dimension">dimension value</a>. Use <code>Resources.getDimension()</code> to get
+ <li><strong>dimens.xml</strong> to define <a href="available-resources.html#dimension">dimension value</a>. Use <code>Resources.getDimension()</code> to get
these resources.</li>
- <li><strong>strings.xml</strong> to define <a href="{@docRoot}reference/available-resources.html#stringresources">string</a> values (use either
+ <li><strong>strings.xml</strong> to define <a href="available-resources.html#stringresources">string</a> values (use either
<code>Resources.getString</code> or preferably <code>Resources.getText()</code>
to get
these resources. <code>getText()</code> will retain any rich text styling
which is usually desirable for UI strings.</li>
- <li><strong>styles.xml</strong> to define <a href="{@docRoot}reference/available-resources.html#stylesandthemes">style</a> objects.</li>
+ <li><strong>styles.xml</strong> to define <a href="available-resources.html#stylesandthemes">style</a> objects.</li>
</ul></td>
</tr>
<tr>
@@ -233,8 +239,7 @@ defined in XML files, or the file name (without the extension) for resources
defined by other file types. Each type of resource will be added to a specific
R subclass, depending on the type of resource it is; to learn which R subclass
hosts your compiled resource type, consult the
-<a href="{@docRoot}reference/available-resources.html">resource
-reference</a> document. Resources compiled by your own application can
+<a href="available-resources.html">Available Resources</a> document. Resources compiled by your own application can
be referred to without a package name (simply as
<code>R.<em>resource_type</em>.<em>resource_name</em></code>). Android contains
a number of standard resources, such as screen styles and button backgrounds. To
@@ -273,7 +278,7 @@ can be localized) and images (which exist in another file), though a reference
can be any resource type including colors and integers.</p>
<p>For example, if we have
-<a href="{@docRoot}reference/available-resources.html#colordrawableresources">color
+<a href="available-resources.html#colordrawableresources">color
resources</a>, we can write a layout file that sets the text color size to be
the value contained in one of those resources:</p>
@@ -394,7 +399,7 @@ public class MyActivity extends Activity
</pre>
<a name="AlternateResources" id="AlternateResources"></a>
-<h2>Supporting Alternate Resources for Alternate Languages and Configurations</h2>
+<h2>Alternate Resources (for alternate languages and configurations)</h2>
<p>You can supply different resources for your product according to the UI
language or hardware configuration on the device. Note that although you can
@@ -485,7 +490,7 @@ MyApp/
<tr>
<td>Primary non-touchscreen<br />
navigation method</td>
- <td><code>notouch</code>, <code>dpad</code>, <code>trackball</code>, <code>wheel</code> </td>
+ <td><code>nonav</code>, <code>dpad</code>, <code>trackball</code>, <code>wheel</code> </td>
</tr>
<tr>
<td>Screen dimensions</td>
@@ -684,7 +689,7 @@ user to select between different global appearances of their device, or
download files with new appearances.</p>
<h2>Resource Reference</h2>
-<p>The <a href="{@docRoot}reference/available-resources.html">Resource Reference</a>
+<p>The <a href="available-resources.html">Available Resources</a>
document provides a detailed list of the various types of resource and how to use them
from within the Java source code, or from other references.</p>
diff --git a/docs/html/guide/topics/security/security.jd b/docs/html/guide/topics/security/security.jd
index 4b258e0..da201c4 100644
--- a/docs/html/guide/topics/security/security.jd
+++ b/docs/html/guide/topics/security/security.jd
@@ -1,31 +1,34 @@
page.title=Security and Permissions
@jd:body
-<p>Android is a multi-process system, where each application (and parts of the
-system) runs in its own process. Most security between applications and
-the system is enforced at the process level through standard Linux facilities,
-such as user and group IDs that are assigned to applications.
-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>
+<div id="qv-wrapper">
+<div id="qv">
-<p>This document covers these topics: </p>
-
-<ul>
+<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>
- <ul>
- <li><a href="#manifest">Enforcing Permissions in AndroidManifest.xml</a></li>
- <li><a href="#broadcasts">Enforcing Permissions when Sending Broadcasts</a></li>
+ <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>
- </ul></li>
-<li>><a href="#uri">URI Permissions</a></li>
-</ul>
+ </ol></li>
+<li><a href="#uri">URI Permissions</a></li>
+</ol>
+</div>
+</div>
+<p>Android is a multi-process system, in which each application (and parts of the
+system) runs in its own process. Most security between applications and
+the system is enforced at the process level through standard Linux facilities,
+such as user and group IDs that are assigned to applications.
+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>
diff --git a/docs/html/guide/topics/sensors/accelerometer.jd b/docs/html/guide/topics/sensors/accelerometer.jd
new file mode 100644
index 0000000..da760bc
--- /dev/null
+++ b/docs/html/guide/topics/sensors/accelerometer.jd
@@ -0,0 +1,18 @@
+page.title=Accelerometer
+parent.title=Sensors
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>In this document</h2>
+ <ol>
+
+ </ol>
+
+</div>
+</div>
+
+
+TODO \ No newline at end of file
diff --git a/docs/html/guide/topics/sensors/camera.jd b/docs/html/guide/topics/sensors/camera.jd
new file mode 100644
index 0000000..821333e
--- /dev/null
+++ b/docs/html/guide/topics/sensors/camera.jd
@@ -0,0 +1,18 @@
+page.title=Camera
+parent.title=Sensors
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>Key class</h2>
+ <ol>
+ <li>{@link android.hardware.Camera android.hardware.Camera}</li>
+ </ol>
+ <h2>In this document</h2>
+ <ol>
+ <li>TODO</li>
+ </ol>
+</div>
+</div> \ No newline at end of file
diff --git a/docs/html/guide/topics/sensors/compass.jd b/docs/html/guide/topics/sensors/compass.jd
new file mode 100644
index 0000000..1e45d2d
--- /dev/null
+++ b/docs/html/guide/topics/sensors/compass.jd
@@ -0,0 +1,18 @@
+page.title=Compass
+parent.title=Sensors
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>In this document</h2>
+ <ol>
+
+ </ol>
+
+</div>
+</div>
+
+
+TODO \ No newline at end of file
diff --git a/docs/html/guide/topics/sensors/index.jd b/docs/html/guide/topics/sensors/index.jd
new file mode 100644
index 0000000..54a0814
--- /dev/null
+++ b/docs/html/guide/topics/sensors/index.jd
@@ -0,0 +1,13 @@
+page.title=Sensors
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+
+
+<h2>Accelerometer</h2>
+<p>The accelerometer sensors allow you to detect the various movements of the device.</p>
+
+<h2>Compass</h2>
+<p>The compass provides data on the devices current polar orientation.</p> \ No newline at end of file
diff --git a/docs/html/guide/topics/views/binding.jd b/docs/html/guide/topics/views/binding.jd
index e6fa3ea..ce57ac4 100644
--- a/docs/html/guide/topics/views/binding.jd
+++ b/docs/html/guide/topics/views/binding.jd
@@ -1,7 +1,27 @@
page.title=Binding to Data with AdapterView
+parent.title=Views and Layout
+parent.link=index.html
@jd:body
-<p>Some types of ViewGroup objects have a UI that is visible on the screen &mdash; {@link android.widget.AdapterView AdapterView} is one such object. 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 (versus resource strings or drawables) in your layout.</p>
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#FillingTheLayout">Filling the Layout with Data</a></li>
+ <li><a href="#HandlingUserSelections">Handling User Selections</a></li>
+ </ol>
+
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/tutorials/views/hello-spinner.html">Hello Spinner tutorial</a></li>
+ <li><a href="{@docRoot}guide/tutorials/views/hello-listview.html">Hello ListView tutorial</a></li>
+ <li><a href="{@docRoot}guide/tutorials/views/hello-gridview.html">Hello GridView tutorial</a></li>
+ </ol>
+</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>
@@ -14,15 +34,18 @@ page.title=Binding to Data with AdapterView
</li>
</ul>
-<p>The sections below describe how the AdapterView fulfills those responsibilities.</p>
-
-<h3>
- Filling the layout with data
-</h3>
-<p>This is typically done by binding the class to an {@link
-android.widget.Adapter} that gets its data from somewhere &mdash; either a list that
-the code supplies, or query results from the device's database. </p>
+<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 retireves 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
@@ -57,10 +80,10 @@ s2.setAdapter(adapter2);
<p>Note that it is necessary to have the People._ID column in projection used with CursorAdapter
or else you will get an exception.</p>
-<h3>
- Handling user selections
-</h3>
-<p> This is done by setting the class's {@link
+
+
+<h2 id="HandlingUserSelections">Handling User Selections</h2>
+<p>You handle the user's selecction by setting the class's {@link
android.widget.AdapterView.OnItemClickListener} member to a listener and
catching the selection changes. </p>
<pre>
@@ -78,3 +101,10 @@ private OnItemClickListener mMessageClickedHandler = new OnItemClickListener() {
mHistoryView = (ListView)findViewById(R.id.history);
mHistoryView.setOnItemClickListener(mMessageClickedHandler);
</pre>
+
+<div class="special">
+<p>For more discussion on how to create different AdapterViews, read the following tutorials:
+<a href="{@docRoot}guide/tutorials/views/hello-spinner.html">Hello Spinner</a>,
+<a href="{@docRoot}guide/tutorials/views/hello-listview.html">Hello ListView</a>, and
+<a href="{@docRoot}guide/tutorials/views/hello-gridview.html">Hello GridView</a>.
+</div>
diff --git a/docs/html/guide/topics/views/custom-components.jd b/docs/html/guide/topics/views/custom-components.jd
new file mode 100644
index 0000000..9e7943b
--- /dev/null
+++ b/docs/html/guide/topics/views/custom-components.jd
@@ -0,0 +1,563 @@
+page.title=Building Custom Components
+parent.title=Views and Layout
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#basic">The Basic Approach</a></li>
+ <li><a href="#custom">Fully Customized Components</a></li>
+ <li><a href="#compound">Compound Controls</a></li>
+ <li><a href="#modifying">Modifying an Existing View Type</a></li>
+ </ol>
+</div>
+</div>
+
+<p>Android offers a sophisticated and powerful componentized model for building your UI,
+based on the fundamental layout classes: {@link android.view.View} and
+{@link android.view.ViewGroup}. To start with, the platform includes a variety of prebuilt
+View and ViewGroup subclasses &mdash; called widgets and layouts, respectively &mdash;
+that you can use to construct your UI.</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.html">Common Layout Objects</a>.</p>
+
+<p>If none of the prebuilt widgets or layouts meets your needs, you can create your own View subclass.
+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}guide/samples/NotePad/index.html">Notepad Tutorial</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>
+
+
+<h2 id="basic">The Basic Approach</h2>
+
+<p>Here is 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()}.
+ 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 lifecycle and other functionality hooks.
+ <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.
+ </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>
+
+
+
+<h2 id="custom">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 &mdash; which is
+ probably not what you want.
+ </li>
+ <li>
+ Other <code>on...</code> methods may also be overridden as required.
+ </li>
+</ol>
+
+<h3>Extend <code>onDraw()</code> and <code>onMeasure()</code></h3>
+<p>The <code>onDraw()</code> method 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 class="note"><strong>Note:</strong>
+This does not apply to 3D graphics. If you want to
+use 3D graphics, you must extend {@link android.view.SurfaceView SurfaceView}
+instead of View, and draw from a seperate 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>
+
+
+
+<h3 id="customexample">A Custom View Example</h3>
+<p>The CustomView sample in the
+<a href="{@docRoot}guide/samples/ApiDemos/index.html">API Demos</a> provides an example
+of a customized View. The custom View is defined in the
+<a href="{@docRoot}guide/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}guide/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>
+
+
+<h2 id="compound">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 &mdash; 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>
+
+
+
+<h2 id="modifying">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 heirarchy, 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}guide/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}guide/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:<br/>
+ <code>public static class MyEditText extends EditText</code></p>
+
+ <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.
+ </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> &mdash; 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>
+&lt;view
+ class=&quot;com.android.notepad.NoteEditor$MyEditText&quot;
+ id=&quot;&#64;+id/note&quot;
+ android:layout_width=&quot;fill_parent&quot;
+ android:layout_height=&quot;fill_parent&quot;
+ android:background=&quot;&#64;android:drawable/empty&quot;
+ android:padding=&quot;10dip&quot;
+ android:scrollbars=&quot;vertical&quot;
+ android:fadingEdge=&quot;vertical&quot; /&gt;
+</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.
+ <p>If your custom View component is not defined as an inner class, then you can,
+ alternatively, declare the View component
+ with the XML element name, and exclude the <code>class</code> attribute. For example:</p>
+<pre>
+&lt;com.android.notepad.MyEditText
+ id=&quot;&#64;+id/note&quot;
+ ... />
+</pre>
+ <p>Notice that the <code>MyEditText</code> class is now a separate class file. When the class
+ is nested in the <code>NoteEditor</code> class, this technique will not work.</p>
+ </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 &mdash; 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/custom-views.jd b/docs/html/guide/topics/views/custom-views.jd
index 9850e17..c5f9346 100644
--- a/docs/html/guide/topics/views/custom-views.jd
+++ b/docs/html/guide/topics/views/custom-views.jd
@@ -1,10 +1,8 @@
page.title=Building Custom Views
+parent.title=Views and Layout
+parent.link=index.html
@jd:body
-<p>Android comes with a solid collection of Views that you can use
-to construct your applications, for example:</p>
-
-
<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 &mdash; called widgets and layouts, respectively &mdash; 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},
@@ -20,9 +18,9 @@ to construct your applications, for example:</p>
{@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>
+{@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
+<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>
@@ -42,8 +40,8 @@ to construct your applications, for example:</p>
</li>
<li>
You could override the way that an EditText component is rendered on the screen
- (the Notepad tutorial uses this to good effect, to create a lined-notepad
- page).
+ (the <a href="{@docRoot}guide/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
@@ -52,19 +50,16 @@ to construct your applications, for example:</p>
</ul>
<p>
The sections below explain how to create custom Views and use them in your application.
-</p>
+For detailed reference information, see the {@link android.view.View} class. </p>
-<p>For detailed information, see {android.view.View}. </p>
-
-
-<h2 style="clear:right;">Contents</h2>
-<dl>
-<dt><a href="#basic">The Basic Approach</a></dt>
-<dt><a href="#custom">Fully Customized Views</a></dt>
-<dt><a href="#customexample">Customized View Example</a></dt>
-<dt><a href="#compound">Compound Controls</a></dt>
-<dt><a href="#tweaking">Modifying an Existing Component Type</a></dt>
-</dl>
+<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
@@ -98,7 +93,7 @@ View components:</p>
functionality.
</li>
</ol>
-<p class="note">
+<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
@@ -201,7 +196,116 @@ result will be an exception at measurement time.</p>
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
diff --git a/docs/html/guide/topics/views/declaring-layout.jd b/docs/html/guide/topics/views/declaring-layout.jd
new file mode 100644
index 0000000..43afdf7
--- /dev/null
+++ b/docs/html/guide/topics/views/declaring-layout.jd
@@ -0,0 +1,228 @@
+page.title=Declaring Layout
+parent.title=Views and Layout
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#LoadingTheResource">Loading the XML Resource</a></li>
+ <li><a href="#Position">Position</a></li>
+ <li><a href="#SizePaddingMargin">Size, Padding and Margins</a></li>
+ </ol>
+</div>
+</div>
+
+<p>You can create your application's user interface in two ways:
+<ul>
+<li><strong>Declare UI elements statically, in XML</strong>. Android provides a straightforward XML
+vocabulary that corresponds to the View classes and subclasses, such as those for widgets and layouts. </li>
+<li><strong>Instantiate screen elements at runtime</strong>. 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>
+
+<div class="sidebox">
+ <p>The <a href="{@docRoot}guide/developing/tools/adt.html">Android Development Tools</a>
+ (ADT) plugin for Eclipse offers a layout preview of your XML &mdash;
+ with the XML file opened, select the <strong>Layout</strong> tab.</p>
+ <p>You should also try the
+ <a href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a> tool,
+ for debugging layouts &mdash; it reveals layout property values,
+ draws wireframes with padding/margin indicators, and full rendered views while
+ you debug on the emulator or device.</p>
+</div>
+
+<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
+<code>EditText.setText()</code>. </p>
+
+<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}guide/topics/resources/available-resources.html#layoutresources">Layout Resources</a>.</p>
+ </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 &mdash; 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 your application's <code>res/layout/</code> directory, so it will properly compile. </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).
+See <a href="how-android-draws.html">How Android Draws Views</a> for more information.</p>
+
+<p>Attributes named <code>layout_<em>something</em></code> apply to that
+object's LayoutParams member. <a href="{@docRoot}guide/topics/resources/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 &mdash; best for text size) </li>
+ <li>pt (points) </li>
+ <li>in (inches) </li>
+ <li>mm (millimeters) </li>
+</ul>
+
+<p>Example: <code>android:layout_width=&quot;25px&quot;</code> </p>
+
+<p>For more information about these dimensions, see <a href="{@docRoot}guide/topics/resources/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>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!-- Demonstrates using a relative layout to create a form --&gt;
+&lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android
+ android:layout_width=&quot;fill_parent&quot;
+ android:layout_height=&quot;wrap_content&quot;
+ android:background=&quot;@drawable/blue&quot;
+ android:padding=&quot;10px&quot;&gt;
+
+ &lt;TextView id=&quot;@+id/label&quot;
+ android:layout_width=&quot;fill_parent&quot;
+ android:layout_height=&quot;wrap_content&quot;
+ android:text=&quot;Type here:&quot;/&gt;
+
+ &lt;EditText id=&quot;@+id/entry&quot;
+ android:layout_width=&quot;fill_parent&quot;
+ android:layout_height=&quot;wrap_content&quot;
+ android:background=&quot;@android:drawable/editbox_background&quot;
+ android:layout_below=&quot;@id/label&quot;/&gt;
+
+ &lt;Button id=&quot;@+id/ok&quot;
+ android:layout_width=&quot;wrap_content&quot;
+ android:layout_height=&quot;wrap_content&quot;
+ android:layout_below=&quot;@id/entry&quot;
+ android:layout_alignParentRight=&quot;true&quot;
+ android:layout_marginLeft=&quot;10px&quot;
+ android:text=&quot;OK&quot; /&gt;
+
+ &lt;Button android:layout_width=&quot;wrap_content&quot;
+ android:layout_height=&quot;wrap_content&quot;
+ android:layout_toLeftOf=&quot;@id/ok&quot;
+ android:layout_alignTop=&quot;@id/ok&quot;
+ android:text=&quot;Cancel&quot; /&gt;
+&lt;/RelativeLayout&gt;</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>
+
+
+<h2 id="LoadingTheResource">Loading the XML Resource</h2>
+<p>Loading the compiled layout resource is very easy, and done with a single
+call in the activity's <code>onCreate()</code> method, as shown here:</p>
+
+<pre>
+protected void onCreate(Bundle savedInstanceState)
+{
+ // Be sure to call the super class.
+ super.onCreate(savedInstanceState);
+
+ // 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(savedInstanceState);
+} </pre>
+
+<h2 id="Position">Position</h2>
+ <p>
+ The geometry of a view is that of a rectangle. A view has a location,
+ expressed as a pair of <em>left</em> and <em>top</em> coordinates, and
+ two dimensions, expressed as a width and a height. The unit for location
+ and dimensions is the pixel.
+ </p>
+
+ <p>
+ It is possible to retrieve the location of a view by invoking the methods
+ {@link android.view.View#getLeft()} and {@link android.view.View#getTop()}. The former returns the left, or X,
+ coordinate of the rectangle representing the view. The latter returns the
+ top, or Y, coordinate of the rectangle representing the view. These methods
+ both return the location of the view relative to its parent. For instance,
+ when getLeft() returns 20, that means the view is located 20 pixels to the
+ right of the left edge of its direct parent.
+ </p>
+
+ <p>
+ In addition, several convenience methods are offered to avoid unnecessary
+ computations, namely {@link android.view.View#getRight()} and {@link android.view.View#getBottom()}.
+ These methods return the coordinates of the right and bottom edges of the
+ rectangle representing the view. For instance, calling {@link android.view.View#getRight()}
+ is similar to the following computation: <code>getLeft() + getWidth()</code>.
+ </p>
+
+
+<h2 id="SizePaddingMargins">Size, Padding and Margins</h2>
+ <p>
+ The size of a view is expressed with a width and a height. A view actually
+ possess two pairs of width and height values.
+ </p>
+
+ <p>
+ The first pair is known as <em>measured width</em> and
+ <em>measured height</em>. These dimensions define how big a view wants to be
+ within its parent. The
+ measured dimensions can be obtained by calling {@link android.view.View#getMeasuredWidth()}
+ and {@link android.view.View#getMeasuredHeight()}.
+ </p>
+
+ <p>
+ The second pair is simply known as <em>width</em> and <em>height</em>, or
+ sometimes <em>drawing width</em> and <em>drawing height</em>. These
+ dimensions define the actual size of the view on screen, at drawing time and
+ after layout. These values may, but do not have to, be different from the
+ measured width and height. The width and height can be obtained by calling
+ {@link android.view.View#getWidth()} and {@link android.view.View#getHeight()}.
+ </p>
+
+ <p>
+ To measure its dimensions, a view takes into account its padding. The padding
+ is expressed in pixels for the left, top, right and bottom parts of the view.
+ Padding can be used to offset the content of the view by a specific amount of
+ pixels. For instance, a left padding of 2 will push the view's content by
+ 2 pixels to the right of the left edge. Padding can be set using the
+ {@link android.view.View#setPadding(int, int, int, int)} method and queried by calling
+ {@link android.view.View#getPaddingLeft()}, {@link android.view.View#getPaddingTop()},
+ {@link android.view.View#getPaddingRight()} and {@link android.view.View#getPaddingBottom()}.
+ </p>
+
+ <p>
+ Even though a view can define a padding, it does not provide any support for
+ margins. However, view groups provide such a support. Refer to
+ {@link android.view.ViewGroup} and
+ {@link android.view.ViewGroup.MarginLayoutParams} for further information.
+ </p>
+ \ No newline at end of file
diff --git a/docs/html/guide/topics/views/how-android-draws.jd b/docs/html/guide/topics/views/how-android-draws.jd
new file mode 100644
index 0000000..f497db7
--- /dev/null
+++ b/docs/html/guide/topics/views/how-android-draws.jd
@@ -0,0 +1,90 @@
+page.title=How Android Draws Views
+parent.title=Views and Layout
+parent.link=index.html
+@jd:body
+
+
+<p>As mentioned in the introduction to <a href="index.html">Views and Layout</a>,
+drawing begins when the Activity requests the root node of the layout to measure and
+draw the layout tree. Drawing is handled by walking the tree and rendering each view that
+ intersects the invalid region. In turn, each view group is responsible for requesting
+each of its children to be drawn and each view is responsible for drawing itself.
+ Because the tree is traversed in-order,
+ this means that parents will be drawn before (i.e., behind) their children, with
+ siblings drawn in the order they appear in the tree.
+ </p>
+
+<div class="sidebox">
+ <p>The framework will not draw views that are not in the invalid region, and also
+ will take care of drawing the views background for you.</p>
+ <p>You can force a view to draw, by calling {@link android.view.View#invalidate()}.
+ </p>
+</div>
+
+<p>
+ Drawing the layout is a two pass process: a measure pass and a layout pass. The measuring
+ pass is implemented in {@link android.view.View#measure(int, int)} and is a top-down traversal
+ of the view tree. Each view pushes dimension specifications down the tree
+ during the recursion. At the end of the measure pass, every view has stored
+ its measurements. The second pass happens in
+ {@link android.view.View#layout(int,int,int,int)} and is also top-down. During
+ this pass each parent is responsible for positioning all of its children
+ using the sizes computed in the measure pass.
+ </p>
+
+ <p>
+ When a view's measure() method returns, its {@link android.view.View#getMeasuredWidth()} and
+ {@link android.view.View#getMeasuredHeight()} values must be set, along with those for all of
+ that view's descendants. A view's measured width and measured height values
+ must respect the constraints imposed by the view's parents. This guarantees
+ that at the end of the measure pass, all parents accept all of their
+ children's measurements. A parent view may call measure() more than once on
+ its children. For example, the parent may measure each child once with
+ unspecified dimensions to find out how big they want to be, then call
+ measure() on them again with actual numbers if the sum of all the children's
+ unconstrained sizes is too big or too small (i.e., if the children don't agree among themselves
+ as to how much space they each get, the parent will intervene and set the rules on the second pass).
+ </p>
+
+ <div class="sidebox"><p>
+ To intiate a layout, call {@link android.view.View#requestLayout}. This method is typically
+ called by a view on itself when it believes that is can no longer fit within
+ its current bounds.</p>
+ </div>
+
+ <p>
+ The measure pass uses two classes to communicate dimensions. The
+ {@link android.view.View.MeasureSpec} class is used by views to tell their parents how they
+ want to be measured and positioned. The base LayoutParams class just
+ describes how big the view wants to be for both width and height. For each
+ dimension, it can specify one of:</p>
+ <ul>
+ <li> an exact number
+ <li>FILL_PARENT, which means the view wants to be as big as its parent
+ (minus padding)</li>
+ <li> WRAP_CONTENT, which means that the view wants to be just big enough to
+ enclose its content (plus padding).</li>
+ </ul>
+ <p>There are subclasses of LayoutParams for different subclasses of ViewGroup.
+ For example, AbsoluteLayout has its own subclass of LayoutParams which adds
+ an X and Y value.
+ </p>
+
+ <p>
+ MeasureSpecs are used to push requirements down the tree from parent to
+ child. A MeasureSpec can be in one of three modes:</p>
+ <ul>
+ <li>UNSPECIFIED: This is used by a parent to determine the desired dimension
+ of a child view. For example, a LinearLayout may call measure() on its child
+ with the height set to UNSPECIFIED and a width of EXACTLY 240 to find out how
+ tall the child view wants to be given a width of 240 pixels.</li>
+ <li>EXACTLY: This is used by the parent to impose an exact size on the
+ child. The child must use this size, and guarantee that all of its
+ descendants will fit within this size.</li>
+ <li>AT_MOST: This is used by the parent to impose a maximum size on the
+ child. The child must gurantee that it and all of its descendants will fit
+ within this size.</li>
+ </ul>
+
+
+
diff --git a/docs/html/guide/topics/views/index.jd b/docs/html/guide/topics/views/index.jd
index 9a15921d..a246ba1 100644
--- a/docs/html/guide/topics/views/index.jd
+++ b/docs/html/guide/topics/views/index.jd
@@ -1,45 +1,216 @@
page.title=Views and Layout
@jd:body
-<p>To build a user interface fors your Android application, you work with <em>views</em> and <em>viewgroups</em> -- basic units of user interface expression on the Android platform. All views and viewgroups are descendants of the class {@link android.view.View}. To help you build your UI more quickly, Android provides a set of fully implemented views and viewgroups &mdash; called widgets and layouts &mdash; that you can use.
+<div id="qv-wrapper">
+<div id="qv">
-The topics below describe the basics of how you use views to implement a user interface. including the types of screen elements available, the ways that you can declare them in your application, how you can bind a screen elements to local data, and how views can catch and handle screen or keypad events. </p>
+ <h2>Key classes and packages</h2>
+ <ol>
+ <li>{@link android.view.View}</li>
+ <li>{@link android.view.ViewGroup}</li>
+ <li>{@link android.widget}</li>
+ </ol>
-<p>For a quick start on how to create the Views you need for your UI, check out the <a href="{@docRoot}guide/tutorials/views/hello-views-index.html">Hello Views tutorials</a>. You can look at a variety of available layouts and screen elements as they would be rendered on a device, then look at the code for declaring and invoking each one. </p>
+ <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">Events</a></li>
+ <li><a href="#Adapters">Adapters</a></li>
+ <li><a href="#StylesAndThemes">Styles and Themes</a></li>
+ </ol>
+</div>
+</div>
+
+<p>In an Android application, a 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 properties 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 screen area it represents. </p>
+
+
+<h2 id="ViewHierarchy">View Hierarchy</h2>
+
+<p>On the Android platform, you will define an Activity's UI using a hierarchy of view and view group 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 view types that you
+create yourself.</p>
+
+<img src="{@docRoot}images/viewgroup.png" alt="" width="312" height="211" align="center"/>
+
+<p>The Android system will notify your Activity when it becomes active and receives focus.
+In order to attach the view hierarchy tree to the screen for rendering, your Activity must call its
+<code>setContentView()</code> method and pass a reference to the root node object. The Android system
+receives this reference so that it can invalidate, measure, and draw the tree. The root node requests
+that its child nodes draw themselves &mdash; in turn, each view group node is responsible for
+calling <code>Draw()</code> on each of its own child views, so that each child view can render itself.
+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. To learn more about how a view group and its children are measured
+and drawn, read <a href="how-android-draws.html">How Android Draws Views</a>.</p>
-<p>You can find additional sample code in the API Demos application, included in the SDK's samples directory. </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
+(usually a descendant of) either a View or ViewGroup object. View objects are leaves in the tree,
+ViewGroup objects are branches in the tree. The name of an XML element
+is the respective class object name. So a <code>&lt;TextView></code> element creates
+a {@link android.widget.TextView} widget in your UI, and a <code>&lt;LinearLayout></code> element creates
+a {@link android.widget.LinearLayout} layout branch in the tree. To learn more about how to write your layout in XML,
+read <a href="declaring-layout.html">Declaring and Querying Layout</a>.
+
+<div class="sidebox-wrapper">
<div class="sidebox">
-<p>Using Android resources is an important part of building your application's user interface. For information about what resources are available to you and how you use them, see the <a href="{@docRoot}guide/topics/resources/index.html">Resources</a> topics area.</p>
+ <p><b>Tip:</b> You can also draw new views and view groups from within your code,
+ by adding new View and ViewGroup objects to an
+ existing ViewGroup (specifically, you'll use the <code>addView()</code> methods to dynamically insert new views).
+ To see how to add views in your code, see the {@link android.view.ViewGroup} reference.</p>
+</div>
</div>
+<p>There are a variety of ways in which you can layout your views, using different view groups.
+Some pre-defined view groups offered by Android (called layouts) include LinearLayout, RelativeLayout, AbsoluteLayout,
+TableLayout, GridLayout and others. Each offers a different mechanisms for arranging child views
+among each other.
+To learn more about how to use some of these view groups for your layout,
+read <a href="layout.html">Common Layout Objects</a>.
+
+<h3 id="IDs">IDs</h3>
+
+<p>Views may have an integer ID associated with them. The ID is written as a string, but once the application is
+compiled, it will be referenced as an integer.
+These IDs are typically assigned in the layout XML file as an attribute of the view,
+and are used to uniquely identify a view within the tree. The usual syntax for an ID, inside an XML tag is:</p>
+<pre>id="&#64;+id/my_button"</pre>
+<p>The at-symbol (&#64;) at the beginning of the string indicates that the XML parser should parse and expand the rest
+of the ID string and identify it as an ID resource. The plus-symbol (+) means that this is a new resource name that must
+be created and added to our resources (in the <code>R.java</code> file). There are a number of other ID resources that
+are offered by the Android framework. When referencing an Android resource ID, you do not need the plus-symbol,
+but must add the <code>android</code> package namespace, like so:</p>
+<pre>id="&#64;android:id/empty"</pre>
+<p>With the <code>android</code> package namespace in place, we're now referencing an ID from the <code>android.R</code>
+resources class, rather than the local resources class.</p>
+
+<p>In order to create views and reference them from the application, a common pattern is to:</p>
+<ol>
+ <li>Define a view/widget in the layout file and assign it a unique ID. E.g.:
+<pre>
+&lt;Button id="&#64;+id/my_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="&#64;string/my_button_text"/>
+</pre>
+ </li>
+ <li>Then create an instance of the view object and capture it from the layout
+(typically in the <code>onCreate()</code> method).
+<pre>
+Button myButton = (Button) findViewById(R.id.my_button);
+</pre>
+ </li>
+</ol>
+<p>Defining IDs for view objects is important when creating a {@link android.widget.RelativeLayout}.
+In a relative layout, sibling views can define their layout relative to another sibling view,
+which is referenced by the unique ID.</p>
+<p>An ID need not be unique throughout the entire tree, but it should be
+unique within the part of the tree you are searching (which may often be the entire tree, so it's best
+to be completely unique when possible).</p>
+
+
+<h3>Layout Parameters</h3>
+
+<p>Every ViewGroup class implements a nested class that extends {@link
+android.view.ViewGroup.LayoutParams}. This subclass
+contains property types that define each child view's size and position, as
+appropriate for that type of view group. As you can see in the figure below, the parent
+view group defines layout parameters for each child view (including the child view group).</p>
+
+<img src="{@docRoot}images/layoutparams.png" alt="" height="300" 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,
+though it may also define different LayoutParams for its own children. </p>
+
+<p>All view groups include a width and height, and each view is required to define them.
+Many LayoutParams also include optional margins and
+borders. You can specify width and height with exact measurements, though you probably won't want
+to do this often. More often, you will tell your view to size itself either to
+the dimensions required by its content, or to become as big as its parent view group
+will allow (with the <var>wrap_content</var> and <var>fill_parent</var> values, respectively).
+The accepted measurement types are defined in the
+<a href="{@docRoot}guide/topics/resources/available-resources.html#dimension">Available Resources</a> document.</p>
+
+<h2 id="Widgets">Widgets</h2>
+
+
+<p>The View class also serves as a base class for <em>widgets</em> &mdash; a set of fully implemented
+View subclasses that draw interactive screen elements, so you can quickly build your UI.
+Android provides a vast collection of widgets for special actions.
+Some of them are basic interaction elements like buttons and text fields, while others are more complex,
+like a date picker or zoom controls.</p>
+<p>For a list of all built-in widgets, see the {@link android.widget widget}.</p>
+
+<p>You're not limited to the kinds of views, layouts and widgets provided by the Android platform. If you'd
+like to do something more customized, create your own widget or layout, you can.
+Read more in <a href="custom-components.html">Building Custom Components</a>.
+
+
+<h2 id="Events">Events</h2>
+
+<p>Once you've designed and built your UI layout, you need to handle the user interaction with it.
+Obviously, the views that you've implemented in the layout are the
+receptors for such interaction events. Because the View class is built to listen for most interaction events,
+receiving and handling them is pretty straigh-forward. When you want to perform an action upon an event,
+you need to do one of two things:</p>
<ul>
- <li>
- <a href="hierarchy.html">Hierarchy of Screen Elements</a>
- </li>
- <li>
- <a href="layout.html">Common Layout Objects</a>
- </li>
- <li>
- <a href="ui-xml.html">Declaring a UI in XML</a>
- </li>
- <li>
- <a href="binding.html">Binding to Data with AdapterView</a>
- </li>
- <li>
- <a href="ui-events.html">Handling UI Events</a>
- </li>
- <li>
- <a href="themes.html">Applying Styles and Themes to Your Application</a>
- </li>
- <li>
- <a href="custom-views.html">Building Custom Views</a>
- </li>
- <li>
- <a href="glossary.html">UI Elements and Concepts Glossary</a>
- </li>
- <li>
- <a href="{@docRoot}guide/tutorials/views/hello-views-index.html">Hello Views</a>
- </li>
+ <li>Override an existing callback method for the view you've implemented, which will be called when something
+like a touch or focus event occurs.</li>
+ <li>Define a listener interface, like {@link android.view.View.OnClickListener} (for handling "clicks" on a View).
+You must then define the listener for your view with the respective <code>set...Listener()</code>
+method (such as {@link android.view.View#setOnClickListener(android.view.View.OnClickListener) setOnCLickListener()}).</li>
+</ul>
+<p>To learn more about handling events and writing your own listeners,
+read <a href="ui-events.html">Handling UI Events</a>.</p>
+
+
+<h2 id="Adapters">Adapters</h2>
+
+<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>
+
+
+<h2 id="StylesAndThemes">Styles and Themes</h2>
+
+<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. Learn more about using styles and themes in the
+<a href="themes.html">Applying Styles and Themes</a> document.</p>
diff --git a/docs/html/guide/topics/views/hierarchy.jd b/docs/html/guide/topics/views/intro.jd
index 17a13c1..f49f547 100644
--- a/docs/html/guide/topics/views/hierarchy.jd
+++ b/docs/html/guide/topics/views/intro.jd
@@ -1,4 +1,6 @@
-page.title=Hierarchy of Screen Elements
+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> &mdash; 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>
diff --git a/docs/html/guide/topics/views/layout.jd b/docs/html/guide/topics/views/layout.jd
index f6eedbb..a6fec35 100644
--- a/docs/html/guide/topics/views/layout.jd
+++ b/docs/html/guide/topics/views/layout.jd
@@ -1,60 +1,78 @@
page.title=Common Layout Objects
+parent.title=Views and Layout
+parent.link=index.html
@jd:body
-<p>The sections below describe some of the more common types of layout objects you'll be likely to use in your applications. Like other layouts, they are subclasses of {@link android.view.ViewGroup ViewGroup}.</p>
+<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="#absolutelayout">AbsoluteLayout</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>
-<h2>FrameLayout<a name="framelayout" id="framelayout"></a></h2>
-<p>{@link android.widget.FrameLayout FrameLayout} is the simplest layout
-object. It is intended as a blank reserved space on your screen that you can
-later fill with a single object &mdash; for example, a picture that you'll swap out.
-All child elements are pinned to the top left corner of the screen; you cannot
-specify a location for a child of a {@link android.widget.FrameLayout
-FrameLayout}. Later children will simply be drawn over earlier objects,
+<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 &mdash; 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>LinearLayout<a name="linearlayout" id="linearlayout"></a></h2>
-<p>A {@link android.widget.LinearLayout LinearLayout} aligns all children in a
-single direction &mdash; vertically or horizontally, depending on what property you
-set on the {@link android.widget.LinearLayout LinearLayout}. All children are
+<h2 id="linearlayout">LinearLayout</h2>
+<p>{@link android.widget.LinearLayout LinearLayout} aligns all children in a
+single direction &mdash; 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). {@link
-android.widget.LinearLayout LinearLayout} respects margins between children,
-and also <em>gravity</em> (right, center, or left alignment of a child). </p>
+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 value allows children to expand
-to fill any remaining space on a screen. This prevents a list of small objects
-from being bunched to one end of a large screen, allowing them to expand to
-fill the space. Children specify a weight value, and any remaining space is
+<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. So, for example, if there are three text boxes, and two of
-them declare a weight of 1, two of them will expand equally to fill the
-remaining space, and the third will not grow any additional amount.</p>
+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">
<p><strong>Tip</strong>: To create a proportionate size
-layout on the screen, create a container object that is fill_parent, assign
-the children heights or widths of zero, and then assign relative weight values
+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
-take.</p>
+have.</p>
</div>
<p>The following two forms represent a {@link android.widget.LinearLayout LinearLayout} with a set of elements: a
-button, some labels, some text boxes. Both have padding values to adjust the
-padding nicely. The text boxes have their width set to <code>FILL_PARENT</code>; other
-elements are set to <code>WRAP_CONTENT</code>. The gravity, by default, is left. The form
-on the left has weight values unset (0 by default); the form on the right has
+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>
-<p>
- <img src="{@docRoot}images/linearlayout.png" alt="Linear layout with
-weight attribute." width="421" height="348" />
-</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 &mdash; topmost or
@@ -63,52 +81,75 @@ 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=&quot;false&quot;</code> in the layout XML. </p>
-<h2>TableLayout<a name="tablelayout" id="tablelayout"></a></h2>
-
-<p>{@link android.widget.TableLayout TableLayout} positions its children into rows
- and columns. A TableLayout consists of a number of TableRow objects,
- each defining a row (actually, you can have other children, which will be explained
- below). TableLayout containers do not display border lines for their rows, columns,
- or cells. Each row has zero or more cells; each cell can hold one View object.
- The table has as many columns as the row with the most cells. A table can leave
-cells empty. Cells cannot span columns, as they can in HTML. The following image
- shows a table layout, with the invisible cell borders displayed as dotted lines. </p>
-<p><img src="{@docRoot}images/table_layout.png" alt="TableLayout example" width="499" height="348" /></p>
-<p>Columns can be hidden, can be marked to stretch to fill available screen space,
+<p>To view other sample code, see the
+<a href="{@docRoot}guide/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 image shows a table layout, with the invisible cell borders displayed as dotted lines. </p>
+
+<img src="{@docRoot}images/table_layout.png" alt="" />
+
+<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 reference documentation for this class for more details. </p>
-<h2>AbsoluteLayout<a name="absolutelayout" id="absolutelayout"></a></h2>
-<p>{@link android.widget.AbsoluteLayout AbsoluteLayout} enables children to specify
- exact x/y coordinates to display on the screen, where (0,0) is the upper left
- corner, and values increase as you move down or to the right. Margins are not
+ 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}guide/tutorials/views/hello-tablelayout.html">Hello
+TableLayout</a> tutorial.</p>
+
+
+<h2 id="absolutelayout">AbsoluteLayout</h2>
+<p>{@link android.widget.AbsoluteLayout} enables child views to specify
+ their own exact x/y coordinates on the screen. Coordinates <em>(0,0)</em> is the upper left
+ corner, and values increase as you move down and to the right. Margins are not
supported, and overlapping elements are allowed (although not recommended). We
generally recommend against using AbsoluteLayout unless you have good reasons
- to use it, because it is fairly rigid and does not work well with different device
+ to use it, because it is fairly rigid and does not adjust to different types of
displays. </p>
-<h2>RelativeLayout<a name="relativelayout" id="relativelayout"></a></h2>
-<p>{@link android.widget.RelativeLayout RelativeLayout} lets children specify their
- position relative to each other (specified by ID), or to the parent. So you can
- align two elements by right border, or make one below another, or centered in
- the screen. Elements are rendered in the order given, so if the first element
+
+
+<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. If using XML to specify this layout
- (as described later), a referenced element must be listed before you refer to
- it. </p>
+ 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>Here is an example relative layout with the visible and invisible elements outlined.
The root screen layout object is a RelativeLayout object. </p>
-<p><img src="{@docRoot}images/designing_ui_relative_layout.png" alt="RelativeLayout screen with elements highlighted." width="692" height="440" /></p>
+
+<img src="{@docRoot}images/designing_ui_relative_layout.png" alt="" />
+
<p>This diagram shows the class names of the screen elements, followed by a list
of the properties of each. 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 RelativeLayout parameters are width, height, below, alignTop,
- toLeft, padding, and marginLeft. Note that some of these parameters support values
- relative to other children &mdash; hence the name RelativeLayout. These include the
- toLeft, alignTop, and below properties, which indicate the object to the left,
- top, and below respectively. </p>
-<h2>Summary of Important View Groups<a name="viewgroupsummary" id="viewgroupsummary"></a></h2>
-<p>These objects all hold child UI elements. Some provide visible UI, and others
- only handle child layout. </p>
+ 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 &mdash; 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}guide/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>
diff --git a/docs/html/guide/topics/views/themes.jd b/docs/html/guide/topics/views/themes.jd
index 7c2e973..a206a4b 100644
--- a/docs/html/guide/topics/views/themes.jd
+++ b/docs/html/guide/topics/views/themes.jd
@@ -1,16 +1,39 @@
-page.title=Applying Styles and Themes to Your Application
+page.title=Applying Styles and Themes
+parent.title=Views and Layout
+parent.link=index.html
@jd:body
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/topics/resources/available-resources.html#stylesandthemes">Style and Theme Resources</a></li>
+ </ol>
+</div>
+</div>
+
<p>When designing your application, you can use <em>styles</em> and <em>themes</em> to apply uniform formatting to its various screens and UI elements.
<ul>
-<li>A style is a set of one or more formatting attributes that you can apply as a unit to single elements in your layout XML file(s). For example, you could define a style that specifies a certain text size and color, then apply it to instances of a certain type of View element. </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 to a single Activity. For example, you could define a theme that sets specific colors for the window frame and the panel foreground and background, and sets text sizes and colors for menus, then apply it to the Activities of your application.</li>
+ <li>A style is a set of one or more formatting attributes that you can apply as a unit to single elements in your layout XML file(s). For example, you could define a style that specifies a certain text size and color, then apply it to instances of a certain type of View element.</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 foreground and background, and sets text sizes and colors for menus, then apply it to the activities of your application.</li>
</ul>
-<p>Styles and themes are resources &mdash; Android provides a variety default style and theme resources that you can use, or you can declare your own custom style and theme resources.
+<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>To create custom styles and themes:</p>
+<ol>
+ <li>Create a file named <code>styles.xml</code> in the your application's <code>res/values</code> directory. Add a root <code>&lt;resources></code> node.</li>
+ <li>For each style or theme, add a <code>&lt;style&gt;</code> element with a unique <code>name</code> and, optionally, a <code>parent</code> attribute.
+ The name is used for referencing these styles later, and the parent indicates what style resource to inherit from.</li>
+ <li>Inside the <code>style</code> element, declare format values in one or more <code>&lt;item&gt;</code> element.
+ Each <code>item</code> identifies its style property with a <code>name</code> attribute and defines its style value inside the element.</li>
+ <li>You can then reference the custom resources from other XML resources, your manifest or application code.</li>
+</ol>
-<p>To create custom styles and themes, you declare new resources in an XML file, stored in the your application's <code>res/values</code> directory. You can then reference the custom resources from your other XML resources or manifest or from application code. When declaring styles and themes, in an XML file, you use the same container element &mdash; a <code>&lt;style&gt;</code> element. Inside, you declare format values in one or more <code>&lt;item&gt;</code> elements.</p>
+
+<h2>Styles</h2>
<p>Here's an example declaration of a style: </p>
@@ -24,37 +47,99 @@ page.title=Applying Styles and Themes to Your Application
&lt;/resources&gt;
</pre>
-<p>As shown, you can use <code>&lt;item&gt;</code> elements to set formatting values for the style. The <code>name</code> attribute can refer to a standard string, a hex color value, or a reference to any other resource type.</p>
+<p>As shown, you can use <code>&lt;item&gt;</code> elements to set specific formatting values for the style.
+The <code>name</code> attribute in the <code>item</code> can refer to a standard string, a hex color value,
+or a reference to any other resource type.</p>
+
+<p>Note the <code>parent</code> attribute in the <code>style</code> element. This attribute lets you specify a resource from which the current style will inherit values. The style can inherit from any type of resource that contains the style(s) you want. In general, your styles should always inherit (directly or indirectly) from a standard Android style resource. This way, you only have to define the values that you want to change.</p>
-<p>Note the <code>parent</code> attribute in the <code>style</code> element. This attribute lets you specify a resource from which the current style will inherit values. The style can inherit from any type of resource that holds the style(s) you want. In general, your styles should always inherit (directly or indirectly) from a standard Android style resource, so that you only have to define the values that you want to change.</p>
+<p>Here's how you would reference the custom style from an XML layout, in this case, for an EditText element:</p>
+
+<pre>
+&lt;EditText id="@+id/text1"
+ style="@style/SpecialText"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="Hello, World!" /&gt;
+</pre>
-<p>Here's how you would reference the custom style from a resource delared in XML, in this case, an EditText element:</p>
+<p>Now this EditText widget will be styled as defined by the <code>style</code> example above.</p>
-<pre>&lt;EditText id="@+id/text1"
- style="@style/SpecialText"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Hello, World!" /&gt;</pre>
-<p>Themes are declared in <code>&lt;style&gt;</code> elements also, and are referenced in the same manner, except that you can add a <code>style</code> attribute only to <code>&lt;application&gt;</code> and <code>&lt;activity&gt;</code> elements. If you do not explicitly specify a theme, the Android system applies default theme defined by {@link android.R.style#Theme}.</p>
+<h2>Themes</h2>
-<p>Here's an example of how you would set a theme for all the activites of your application. The example applies a default system theme <code>Theme.Translucent</code>.</p>
+<p>Just like styles, themes are also declared in XML <code>&lt;style&gt;</code> elements, and are referenced in the same manner.
+The difference is that you can add a theme style only to <code>&lt;application&gt;</code> and <code>&lt;activity&gt;</code> elements &mdash;
+they cannot be applied to individual views in the layout.</p>
+
+<p>Here's an example declaration of a theme:</p>
+
+<pre>
+&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;resources&gt;
+ &lt;style name="CustomTheme"&gt;
+ &lt;item name="android:windowNoTitle">true&lt;/item>
+ &lt;item name="windowFrame"&gt;@drawable/screen_frame&lt;/item&gt;
+ &lt;item name="windowBackground"&gt;@drawable/screen_background_white&lt;/item&gt;
+ &lt;item name="panelForegroundColor"&gt;#FF000000&lt;/item&gt;
+ &lt;item name="panelBackgroundColor"&gt;#FFFFFFFF&lt;/item&gt;
+ &lt;item name="panelTextColor"&gt;?panelForegroundColor&lt;/item&gt;
+ &lt;item name="panelTextSize"&gt;14&lt;/item&gt;
+ &lt;item name="menuItemTextColor"&gt;?panelTextColor&lt;/item&gt;
+ &lt;item name="menuItemTextSize"&gt;?panelTextSize&lt;/item&gt;
+ &lt;/style&gt;
+&lt;/resources>
+</pre>
+<p>Notice the use of the at-symbol (@) and the question-mark (?) to reference resources.
+The at-symbol indicates that we're referencing a resource previously defined elsewhere (which may be from
+this project or from the Android framework).
+The question-mark indicates that we're referencing a resource value in the currently loaded theme. This
+is done by referring to a specific <code>&lt;item></code> by its <code>name</code> value. (E.g.,
+<em>panelTextColor</em> uses the same color assigned to <em>panelForegroundColor</em>, defined beforehand.)
+This technique can be used only in XML resources.
+</p>
+
+<h3>Set the theme in the Manifest</h3>
+<p>To set this theme for all the activites of your application, open the Manifest file and
+edit the <code>&lt;application></code> tag to include the <code>android:theme</code> attribute with the
+theme name:</p>
+
+<pre>
+&lt;application android:theme="@style/CustomTheme">
+</pre>
+
+<p>If you want the theme applied to just one Activity in your application, then add the theme
+attribute to the <code>&lt;activity></code> tag, instead.</p>
+
+<p>Just as Android provides other built-in resources, there are several themes that you swap in
+without having to write one yourself. For example, you can use the Dialog theme to make your Activity
+appear like a dialog box. In the manifest, reference an Android theme like so:</p>
+
+<pre>
+&lt;activity android:theme="@android:style/Theme.Dialog">
+</pre>
+
+<p>If you like a theme, but want to slightly tweak it, just add the theme as the <code>parent</code> of your custom theme.
+For example, we'll modify the <code>Theme.Dialog</code> theme. First, we need to import the parent of the
+<code>Dialog</code> theme: <code>Theme</code>. At the top of the <code>resources</code>, add:</p>
+<pre>
+&lt;style name="Theme" parent="@android:Theme">
+ &lt;!-- no modification -->
+&lt;/style>
+</pre>
+<p>Now create a a new theme with <code>Theme.Dialog</code> as the parent:</p>
<pre>
-&lt;!-- AndroidManifest.xml--&gt;
-&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.home"&gt;
- &lt;application android:theme="@android:style/Theme.Translucent" &gt;
- &lt;activity class=".Home"
- ...
- &lt;/activity&gt;
- &lt;/application&gt;
-&lt;/manifest&gt;
+&lt;style name="CustomDialogTheme" parent="@android:style/Theme.Dialog">
</pre>
+<p>There it is. We've inherited the Dialog theme, so we can adjust its styles as we like.
+So, for each item in the Dialog theme that we want to override, we re-define the value under this style and
+then use <var>CustomDialogTheme</var> instead of the <var>Theme.Dialog</var>.</p>
+<h3>Set the theme from the application</h3>
<p>You can also load a theme for an Activity programmatically, if needed.
To do so, use the {@link android.app.Activity#setTheme(int) setTheme()}
-method. Note that, when doing so, be sure to set the theme <em>before</em>
+method. Note that, when doing so, you must be sure to set the theme <em>before</em>
instantiating any Views in the context, for example, before calling
setContentView(View) or inflate(int, ViewGroup). This ensures that
the system applies the same theme for all of your UI screens. Here's an example:</p>
@@ -76,7 +161,7 @@ you want to apply a theme to your main screen, doing so in XML
is a better approach. </p>
<p>For detailed information about custom styles and themes and referencing them from your application, see
-<a href="{@docRoot}reference/available-resources.html#stylesandthemes">Style
+<a href="{@docRoot}guide/topics/resources/available-resources.html#stylesandthemes">Style
and Theme Resources</a>.</p>
<p>For information about default themes and styles available, see {@link android.R.style}.</p>
diff --git a/docs/html/guide/topics/views/ui-events.jd b/docs/html/guide/topics/views/ui-events.jd
index 4230314..96136f8 100644
--- a/docs/html/guide/topics/views/ui-events.jd
+++ b/docs/html/guide/topics/views/ui-events.jd
@@ -1,13 +1,37 @@
page.title=Handling UI Events
+parent.title=Views and Layout
+parent.link=index.html
@jd:body
-<p>Many Android classes declare callback methods for handling relevant UI events such as keypresses, touch events, focus changes, and so on. For example, {@link android.app.Activity Activity} provides the methods onKeyDown() and onKeyUp() and {@link android.widget.TextView TextView} provides onFocusChanged(). </p>
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#TouchMode">Touch Mode</a></li>
+ <li><a href="#Scrolling">Scrolling</a></li>
+ <li><a href="#EventCycle">Event Cycle</a></li>
+ </ol>
-<p>In most cases, you can handle events just by overriding the appropriate handler methods. When an event is received, the Android system calls your handler method with the event data.</p>
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/tutorials/views/hello-formstuff.html">Hello Form Stuff tutorial</a></li>
+ </ol>
+</div>
+</div>
-<p>However, some classes do not declare handler methods for specific events. For example, {@link android.widget.Button Button} does not declare an onClick() handler method. To handle such events, you need to create an anonymous class to act as a listener for the event, then register the listener with the target class object. The example below shows how to set up a handler for click events in a Button object. </p>
+<p>Many Android classes declare callback methods for handling relevant UI events such as keypresses,
+touch events, focus changes, and so on. For example, {@link android.app.Activity Activity} provides
+the methods <code>onKeyDown()</code> and <code>onKeyUp()</code> and {@link android.widget.TextView TextView}
+provides <code>onFocusChanged()</code>. </p>
+<p>In most cases, you can handle events just by overriding the appropriate handler methods.
+When an event is received, the Android system calls your handler method with the event data.</p>
+<p>However, some classes do not declare handler methods for specific events. For example,
+{@link android.widget.Button} does not declare an <code>onClick()</code> handler method. So, to handle a click event,
+you need to create an anonymous class to act as a listener for the event, then register the listener with the
+target class object (via the appropriate <code>set...Listener()</code> method). The example below shows how to set
+up a handler for click events in a Button object. </p>
</p>
<pre>public class ExampleSendResult extends Activity
@@ -16,7 +40,7 @@ page.title=Handling UI Events
{
...
- // Listen for button clicks.
+ // Capture our button from layout and listen for clicks.
Button button = (Button)findViewById(R.id.corky);
button.setOnClickListener(mCorkyListener);
}
@@ -26,6 +50,64 @@ page.title=Handling UI Events
{
public void onClick(View v)
{
- //handle click event...
+ //do something when the button is clicked
}
- };</pre>
+ };
+}
+</pre>
+
+
+<h2 id="TouchMode">Touch Mode</h2>
+ <p>
+ When a user is navigating a user interface via directional keys such as a D-pad, it is
+ necessary to give focus to actionable items such as buttons so the user can see
+ what will take input. If the device has touch capabilities, however, and the user
+ begins interacting with the interface by touching it, it is no longer necessary to
+ always highlight, or give focus to, a particular view. Thus, there is a mode
+ for interaction named "touch mode."
+ </p>
+ <p>
+ For a touch-capable device, once the user touches the screen, the device
+ will enter touch mode. From this point onward, only views for which
+ {@link android.view.View#isFocusableInTouchMode} is true will be focusable, such as text editing widgets.
+ Other views that are touchable, like buttons, will not take focus when touched; they will
+ simply fire their on-click listeners when pressed.
+ </p>
+ <p>
+ Any time a user hits a directional key, such as a D-pad direction, the view device will
+ exit touch mode, and find a view to take focus, so that the user may resume interacting
+ with the user interface without touching the screen.
+ </p>
+ <p>
+ The touch mode state is maintained across {@link android.app.Activity}s. To query the current state, you can call
+ {@link android.view.View#isInTouchMode} to see whether the device is currently in touch mode.
+ </p>
+
+
+<h2 id="Scrolling">Scrolling</h2>
+ <p>
+ The framework provides basic support for views that wish to internally
+ scroll their content. This includes keeping track of the X and Y scroll
+ offset as well as mechanisms for drawing scrollbars. See
+ {@link android.view.View#scrollBy(int, int)}, {@link android.view.View#scrollTo(int, int)} for more details.
+ </p>
+
+<h2 is="EventCycle">Event Cycle</h2>
+ <p>The basic cycle of a view is as follows:</p>
+ <ol>
+ <li>An event comes in and is dispatched to the appropriate view. The view
+ handles the event and notifies any listeners.</li>
+ <li>If, in the course of processing the event, the view's bounds may need
+ to be changed, the view will call {@link android.view.View#requestLayout()}.</li>
+ <li>Similarly, if in the course of processing the event the view's appearance
+ may need to be changed, the view will call {@link android.view.View#invalidate()}.</li>
+ <li>If either {@link android.view.View#requestLayout()} or {@link android.view.View#invalidate()} were called,
+ the framework will take care of measuring, laying out, and drawing the tree
+ as appropriate.</li>
+ </ol>
+
+ <p class="note"><strong>Note:</strong> The entire view tree is single threaded. You must always be on
+ the UI thread when calling any method on any view.
+ If you are doing work on other threads and want to update the state of a view
+ from that thread, you should use a {@link android.os.Handler}.
+ </p> \ No newline at end of file
diff --git a/docs/html/guide/topics/views/ui-xml.jd b/docs/html/guide/topics/views/ui-xml.jd
index f0a23c9..8ae599c 100644
--- a/docs/html/guide/topics/views/ui-xml.jd
+++ b/docs/html/guide/topics/views/ui-xml.jd
@@ -1,4 +1,6 @@
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:
diff --git a/docs/html/guide/topics/wireless/bluetooth.jd b/docs/html/guide/topics/wireless/bluetooth.jd
new file mode 100644
index 0000000..710cd4c
--- /dev/null
+++ b/docs/html/guide/topics/wireless/bluetooth.jd
@@ -0,0 +1,18 @@
+page.title=Bluetooth
+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>
+
+
+TODO \ No newline at end of file
diff --git a/docs/html/guide/topics/wireless/index.jd b/docs/html/guide/topics/wireless/index.jd
new file mode 100644
index 0000000..a3a2b36
--- /dev/null
+++ b/docs/html/guide/topics/wireless/index.jd
@@ -0,0 +1,19 @@
+page.title=Wireless Controls
+@jd:body
+
+
+
+<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 Bluetooth APIs allow applications to scan, connect and pair with other Bluetooth devices.
+THESE APIS ARE NOT YET AVAILABLE.</p>
+
+
+
diff --git a/docs/html/guide/topics/wireless/wifi.jd b/docs/html/guide/topics/wireless/wifi.jd
new file mode 100644
index 0000000..520feaf
--- /dev/null
+++ b/docs/html/guide/topics/wireless/wifi.jd
@@ -0,0 +1,18 @@
+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>
+
+
+TODO \ No newline at end of file
diff --git a/docs/html/guide/tutorials/hello-world.jd b/docs/html/guide/tutorials/hello-world.jd
index ae0d8b5..c993048 100644
--- a/docs/html/guide/tutorials/hello-world.jd
+++ b/docs/html/guide/tutorials/hello-world.jd
@@ -1,114 +1,82 @@
page.title=Hello, World
@jd:body
-<p>First impressions matter, and as a developer you know that the first impression
+<p>As a developer, you know that the first impression
you get of a development framework is how easy it is to write "Hello,
-World." Well, on Android, it's pretty easy. Here's the simple process:</p>
+World." Well, on Android, it's pretty easy. </p>
-<ol>
- <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: Hello, Android</a></li>
-</ol>
-
-<p>Afterwards, there's some additional information that you'll find useful:</p>
-
-<ol>
- <li><a href="#upgrading">Upgrading the UI to an XML Layout</a> </li>
- <li><a href="#debugging">Debugging Your Project</a> </li>
- <li><a href="#noeclipse">Creating a Project without Eclipse</a> </li>
-</ol>
-<p>Let's jump in!</p>
-
-<a name="create"></a>
-
-<h2>Create the Project </h2>
+<p>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. Get <a href="http://www.eclipse.org/downloads/">Eclipse</a> and visit the
+<a href="{@docRoot}guide/developing/tools/adt.html">ADT Plugin</a> page to install it.</p>
-<p>Creating the project is as simple as can be. An Eclipse
-plugin is available making Android development a snap. </p>
+<p>If you're not using Eclipse, that's okay. Familiarize yourself with
+<a href="{@docRoot}guide/developing/other-ide.html">Developing in Other IDEs</a>.
+You can then come back here and ignore anything about Eclipse.</p>
-<p>You'll need to have a development computer with the Eclipse IDE installed (see <a
-href="intro/installing.html#developmentrequirements">System and Software Requirements</a>), and
-you'll need to install the <a
-href="intro/installing.html#installingplugin">Android Eclipse Plugin (ADT)</a>. Once you have those ready, come back here. </p>
+<p class="note"><strong>Note:</strong>
+In some cases, you might want to click the screenshots below to get a bigger view.
+</p>
-<p>First, here's a high-level summary of how to build "Hello, World!":</p>
+<h2 id="create">Create the Project</h2>
-<ol>
- <li>
- Create a new "Android Project" via the <strong>File &gt; New &gt; Project</strong> menu.
- </li>
- <li>
- Fill out the project details in the New Android Project dialog.
- </li>
- <li>
- Edit the auto-generated source code template to display some output.
- </li>
-</ol>
-<p> That's it! Next, let's go through each step above in detail. </p>
<ol class="listhead">
- <li>Create a new Android Project
+ <li>Create a new Android Project.
<p>From Eclipse, select the <strong>File &gt; New &gt; Project</strong> menu item. If the Android
Plugin for Eclipse has been successfully installed, the resulting dialog
should have a folder labeled "Android" which should contain a single entry:
"Android Project".</p>
- <img src="images/hello_world_0.png"/>
+ <a href="images/hello_world_0.png"><img src="images/hello_world_0.png" style="height:230px" alt="" /></a>
- <p>Once you've selected "Android Project", click the Next button.</p>
+ <p>Once you've selected "Android Project", click <strong>Next</strong>.</p>
</li>
- <li>Fill out the project details
- <p>The next screen allows you to enter the relevant details for your project.
- Here's an example:</p>
+ <li>Fill out the project details.
+ <p>The next screen allows you to enter the relevant details for your project:</p>
+ <ul>
+ <li><em>Project name:</em> HelloAndroid</li>
+ <li><em>Package name:</em> com.example.hello (or your own private namespace)</li>
+ <li><em>Activity name:</em> HelloAndroid</li>
+ <li><em>Application name:</em> Hello, Android</li>
+ </ul>
- <img src="images/hello_world_1.png"/>
+ <a href="images/hello_world_1.png"><img src="images/hello_world_1.png" style="height:230px" alt="" /></a>
<p>Here's what each field on this screen means:</p>
+
+ <dl>
+ <dt><em>Project Name</em></dt>
+ <dd>This is the name of the directory or folder on your computer that you
+ want to contain the project.</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 will be generated.
+ <p>The package name you use in your application must be unique across
+ all packages installed on the system; for this reason, it's very
+ important to use a standard domain-style package for your
+ applications. In the example above, we used the
+ package domain "com.android"; you should use a
+ different one appropriate to your organization.</p></dd>
+ <dt><em>Activity Name</em></dt>
+ <dd>This is the name for the class stub that will be generated by the plugin.
+ This will be a subclass of Android's 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.</dd>
+ <dt><em>Application Name</em></dt>
+ <dd>This is the human-readable title for your application.</dd>
+ </dl>
+
+ <p>The checkbox for toggling "Use default location" allows you to change
+ the location on disk where the project's files will be generated and stored.</p>
-
- <table>
- <tbody>
- <tr>
- <td>Project Name </td>
- <td>This is the name of the directory or folder on your computer that you
- want to contain the project.</td>
- </tr>
- <tr>
- <td>Package Name </td>
- <td>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 will be generated.<p/>
- The package name you use in your application must be unique across
- all packages installed on the system; for this reason, it's very
- important to use a standard domain-style package for your
- applications. In the example above, we used the
- package domain "com.android"; you should use a
- different one appropriate to your organization.</td>
- </tr>
- <tr>
- <td>Activity Name </td>
- <td>This is the name for the class stub that will be generated by the plugin.
- This will be a subclass of Android's 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. </td>
- </tr>
- <tr>
- <td> Application Name </td>
- <td> This is the human-readable title for your application. </td>
- </tr>
- </tbody>
- </table>
-
-<p>The checkbox for toggling "Use default location" allows you to change the
-location on disk where the project's files will be generated and stored.</p>
-</li>
-
-<li>Edit the auto-generated source code
+ </li>
-<p>After the plugin runs, you'll have a class named HelloAndroid
-(found in your package, HelloAndroid > src > com.android.hello). It should look like
+<li>Edit the auto-generated source code.
+<p>After the plugin runs, you'll have a class named <code>HelloAndroid</code>
+(found in your package, <em>HelloAndroid > src > com.android.hello</em>). It should look like
this:</p>
<pre>public class HelloAndroid extends Activity {
@@ -126,9 +94,8 @@ So, the next step is to modify some code! </p>
</li>
</ol>
-<a name="ui"></a>
-<h2>Construct the UI</h2>
+<h2 id="ui">Construct the UI</h2>
<p>Take a look at this revised code, below, and make the same changes to your HelloAndroid.java file. We'll dissect
it line by line:</p>
@@ -192,23 +159,23 @@ the TextView we just created.</p>
<p>There it is &mdash; "Hello, World" in Android! The next step, of course, is
to see it running.</p>
-<a name="run"></a>
-<h2>Run the Code: Hello, Android</h2>
+
+<h2 id="run">Run the Code: Hello, Android</h2>
<p>The Eclipse plugin makes it very easy to run your applications. Begin by
selecting the <strong>Run &gt; Open Run Dialog</strong> menu entry (in Eclipse 3.4, it's
<strong>Run > Run Configurations</strong>). You should see a dialog
like this:</p>
- <img src="images/hello_world_2.png"/>
+ <a href="images/hello_world_2.png"><img src="images/hello_world_2.png" style="height:230px" alt="" /></a>
<p>Next, highlight the "Android Application" entry, and then click the icon in the
top left corner (the one depicting a sheet of paper with a plus sign in the
corner) or simply double-click the "Android Application" entry. You should
have a new launcher entry named "New_configuration".</p>
- <img src="images/hello_world_3.png"/>
+ <a href="images/hello_world_3.png"><img src="images/hello_world_3.png" style="height:230px" alt="" /></a>
<p>Change the name to something expressive, like "Hello, Android", and then pick
your project by clicking the Browse button. (If you have more than one
@@ -220,21 +187,21 @@ simply continue.</p>
<p>Click the "Apply" button. Here's an example:</p>
- <img src="images/hello_world_4.png"/>
+ <a href="images/hello_world_4.png"><img src="images/hello_world_4.png" style="height:230px" alt="" /></a>
<p>That's it &mdash; you're done! Click the Run button, and the Android Emulator
should start. Once it's booted up your application will appear. When all is said and done, you should
see something like this:</p>
- <img src="images/hello_world_5.png"/>
+ <a href="images/hello_world_5.png"><img src="images/hello_world_5.png" style="height:230px" alt="" /></a>
<p>That's "Hello, World" in Android. Pretty straightforward, eh?
The next sections of the tutorial offer more detailed information that you may find valuable as you
learn more about Android.</p>
-<a name="upgrading"></a>
-<h2>Upgrading the UI to an XML Layout</h2>
+
+<h2 id="upgrading">Upgrading the UI to an XML Layout</h2>
<p>The "Hello, World" example you just completed uses what we call "programmatic"
UI layout. This means that you construct and build your application's UI
@@ -255,18 +222,18 @@ programmatically-constructed example you just completed:</p>
android:layout_height=&quot;fill_parent&quot;
android:text=&quot;Hello, Android&quot;/&gt;</pre>
-<p>The general structure of an Android XML layout file is simple. It's a tree
-of tags, where each tag is the name of a View class. In this example, it's
-a very simple tree of one element, a TextView. You can use the
-name of any class that extends View as a tag name in your XML layouts,
+<p>The general structure of an Android XML layout file is simple: it's a tree
+of XML elements, where each element is the name of a View class
+(this example, however, is just one element). You can use the
+name of any class that extends View as an element in your XML layouts,
including custom View classes you define in your own code. This
-structure makes it very easy to quickly build up UIs, using a much simpler
+structure makes it very easy to quickly build up UIs, using a more simple
structure and syntax than you would in source code. This model is inspired
by the web development model, where you can separate the presentation of your
application (its UI) from the application logic used to fetch and fill in data.</p>
-<p>In this example, there are also four XML attributes. Here's a summary of what
-they mean:</p>
+<p>In this example, there's just one View element, the <code>TextView</code>,
+which has four XML attributes. Here's a summary of what they mean:</p>
<table>
<tbody>
@@ -314,53 +281,29 @@ they mean:</p>
</table>
-<p>So, that's what the XML layout looks like, but where do you put it? Under the /res/layout directory in your project. The "res" is
+<p>This layout file belongs in the <code>res/layout/</code> directory in your project. The "res" is
short for "resources" and that directory contains all the non-code assets that
-your application requires. This includes things like images, localized
+your application requires. Resources also include things like images, localized
strings, and XML layout files.</p>
-<p>The Eclipse plugin creates one of these XML files for you. In our example
-above, we simply never used it. In the Package Explorer, expand the
-folder /res/layout, and edit the file main.xml. Replace its contents with
-the text above and save your changes.</p>
-
-<p>Now open the file named R.java in your source code folder in the Package
-Explorer. You'll see that it now looks something like this:</p>
-
-<pre>
-public final class R {
- public static final class attr {
- };
- public static final class drawable {
- public static final int icon=0x7f020000;
- };
- public static final class layout {
- public static final int main=0x7f030000;
- };
- public static final class string {
- public static final int app_name=0x7f040000;
- };
-};
-</pre>
-
-<p>A project's R.java 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>
+<div class="sidebox">
+ <h2>Landscape layout</h2>
+ <p>When you want a different design for landscape, put your layout XML file
+ in <code>res/layout-land/</code>. Android will automatically look here when the layout changes.
+ Without it the layout will just be stretched.</p>
+</div>
-<p>The important thing to notice for now is the inner class named "layout", and its
-member field "main". The Eclipse plugin noticed that you added a new XML
-layout file and then regenerated this R.java file. As you add other
-resources to your projects you'll see R.java change to keep up.</p>
+<p>The Eclipse plugin creates one of these XML files for you (<code>main.xml</code>). In our example
+above, we just ignored it and created our layout programmatically. In the Eclipse Package Explorer, expand the
+folder res/layout/, and open the file <code>main.xml</code> (once opened, you might need to click
+the "main.xml" tab at the bottom to see the XML source). Replace its contents with
+the sample XML above and save your changes.</p>
-<p>The last thing you need to do is modify your HelloAndroid source code to use the new
-XML version of your UI, instead of the hard-coded version. Here's what
-your new class will look like. As you can see, the source code becomes much
-simpler:</p>
+<p>Now open and modify your <code>HelloAndroid</code> class source code to read the
+XML layout, instead of the hard-coded version. Edit the file to look like this:</p>
-<pre>package com.android.hello;
+<pre>
+package com.android.hello;
import android.app.Activity;
import android.os.Bundle;
@@ -374,7 +317,11 @@ public class HelloAndroid extends Activity {
}
}</pre>
-<p>When you make this change, don't just copy-and-paste it in. Try out the code-completion feature on that R class. You'll probably find that it helps a lot.</p>
+<p>When you make this change, type it by hand to try the code-completion feature on that R class. You'll probably find that it helps a lot.</p>
+
+<p>The <code>setContentView()</code> method we're now using expects a reference to a layout resource.
+We pass it <code>R.layout.main</code>, which is the reference to the <code>layout/main.xml</code> once it's
+compiled into our R class by the Eclipse plugin. (More about the R class in a moment.)</p>
<p>Now that you've made this change, go ahead and re-run your application &mdash; all
you need to do is click the green Run arrow icon, or select
@@ -383,13 +330,45 @@ you saw before! After all, the point was to show that the two different
layout approaches produce identical results.</p>
<p>There's a lot more to creating these XML layouts, but that's as far as we'll go
-here. Read the <a
-href="{@docRoot}devel/implementing-ui.html">Implementing a User Interface</a> documentation for more
-information on the power of this approach.</p>
+here. Read the <a href="{@docRoot}guide/topics/views/index.html">Views and Layout</a> documentation for more
+information on creating layouts.</p>
-<a name="debugging"></a>
+<div class="special">
+<h3>R class</h3>
+<p>Open the file named R.java in your source code folder in the Package
+Explorer. It should look something like this:</p>
-<h2>Debugging Your Project</h2>
+<pre>
+public final class R {
+ public static final class attr {
+ };
+ public static final class drawable {
+ public static final int icon=0x7f020000;
+ };
+ public static final class layout {
+ public static final int main=0x7f030000;
+ };
+ public static final class string {
+ public static final int app_name=0x7f040000;
+ };
+};
+</pre>
+
+<p>A project's R.java 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>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 (in the <code>res/</code> directory), you'll see R.java change to keep up.</p>
+<p><em>You should never edit this file by hand.</em></p>
+</div>
+
+<h2 id="debugging">Debugging Your Project</h2>
<p>The Android Plugin for Eclipse also has excellent integration with the Eclipse
debugger. To demonstrate this, let's introduce a bug into
@@ -415,7 +394,7 @@ public class HelloAndroid extends Activity {
<p>This change simply introduces a NullPointerException into your code. If
you run your application again, you'll eventually see this:</p>
- <img src="images/hello_world_8.png"/>
+ <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>
@@ -426,36 +405,35 @@ 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>
- <img src="images/hello_world_9.png"/>
-
-<a name="noeclipse"></a>
-
-<h2>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 &mdash; 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="tools.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 Python script named "activitycreator.py" that can be
-used to create all the source code and directory stubs for your project, as well
-as an ant-compatible build.xml 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 we just created
-via Eclipse, you'd use this command:</p>
-
-<pre>activitycreator.py --out HelloAndroid com.android.hello.HelloAndroid</pre>
-
-<p>To build the project, you'd then run the command 'ant'. When that command
-successfully completes, you'll be left with a file named HelloAndroid.apk under
-the 'bin' directory. That .apk file is an Android Package, and can be
-installed and run in your emulator using the 'adb' tool.</p>
-
-<p>For more information on how to use these tools, please read the documentation
-cited above.</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 &mdash; 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 Python script named "activitycreator.py" that can be
+ used to create all the source code and directory stubs for your project, as well
+ as an ant-compatible build.xml 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 we just created
+ via Eclipse, you'd use this command:</p>
+
+ <pre>activitycreator.py --out HelloAndroid com.android.hello.HelloAndroid</pre>
+
+ <p>To build the project, you'd then run the command 'ant'. When that command
+ successfully completes, you'll be left with a file named HelloAndroid.apk under
+ the 'bin' directory. That .apk file is an Android Package, and can be
+ installed and run in your emulator using the 'adb' tool.</p>
+
+ <p>For more information on how to use these tools, please read the documentation
+ cited above.</p> \ 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
index 94a4c04..c174fba 100644
--- a/docs/html/guide/tutorials/images/hello_world_0.png
+++ b/docs/html/guide/tutorials/images/hello_world_0.png
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
index 9d28044..f08438a 100644
--- a/docs/html/guide/tutorials/images/hello_world_1.png
+++ b/docs/html/guide/tutorials/images/hello_world_1.png
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
index 76e7155..58f5703 100644
--- a/docs/html/guide/tutorials/images/hello_world_2.png
+++ b/docs/html/guide/tutorials/images/hello_world_2.png
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
index 8319374..d2d2ff6 100644
--- a/docs/html/guide/tutorials/images/hello_world_3.png
+++ b/docs/html/guide/tutorials/images/hello_world_3.png
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
index 164256c..5c41e80 100644
--- a/docs/html/guide/tutorials/images/hello_world_4.png
+++ b/docs/html/guide/tutorials/images/hello_world_4.png
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
index b17ca8b..96b830a 100644
--- a/docs/html/guide/tutorials/images/hello_world_5.png
+++ b/docs/html/guide/tutorials/images/hello_world_5.png
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
index 2429ba0..07db360 100644
--- a/docs/html/guide/tutorials/images/hello_world_8.png
+++ b/docs/html/guide/tutorials/images/hello_world_8.png
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
index e92fb4b..e172e63 100644
--- a/docs/html/guide/tutorials/images/hello_world_9.png
+++ b/docs/html/guide/tutorials/images/hello_world_9.png
Binary files differ
diff --git a/docs/html/guide/tutorials/notepad/index.jd b/docs/html/guide/tutorials/notepad/index.jd
new file mode 100644
index 0000000..6319fad
--- /dev/null
+++ b/docs/html/guide/tutorials/notepad/index.jd
@@ -0,0 +1,142 @@
+page.title=Notepad Tutorial
+@jd:body
+
+
+<p>This tutorial on writing a notepad application gives you a &quot;hands-on&quot; 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 application development as a set of
+exercises (see below), each consisting of several steps. You should follow
+the steps in each exercise to gradually build 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 will have learned 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 Note Pad application, in the
+<a href="{@docRoot}guide/samples/index.html">Sample Code</a> section. </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>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>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
+Fundamentals</a> before continuing. </p>
+
+<p>This tutorial also builds on the introductory information provided in the
+<a href="{@docRoot}guide/tutorials/hello-world.html">Hello World</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>
+
+<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}guide/tutorials/notepad/notepad-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}guide/tutorials/notepad/notepad-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}guide/tutorials/notepad/notepad-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}guide/tutorials/notepad/notepad-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}guide/appendix/faq/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, or browser them
+here, in the <a href="{@docRoot}guide/samples/index.html">Sample Code</a> section.</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/notepad/notepad-ex1.jd b/docs/html/guide/tutorials/notepad/notepad-ex1.jd
index 715267f..45ed97e 100644
--- a/docs/html/guide/tutorials/notepad/notepad-ex1.jd
+++ b/docs/html/guide/tutorials/notepad/notepad-ex1.jd
@@ -17,10 +17,10 @@ selections. </em></li>
<div style="float:right;white-space:nowrap">
<span style="color:#BBB;">
- [<a href="tutorial-ex1.html" style="color:#BBB;">Exercise 1</a>]</span>
- [<a href="tutorial-ex2.html">Exercise 2</a>]
- [<a href="tutorial-ex3.html">Exercise 3</a>]
- [<a href="tutorial-extra-credit.html">Extra Credit</a>]
+ [<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>
@@ -31,8 +31,8 @@ selections. </em></li>
<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}intro/hello-android.html">Hello
- Android tutorial.</a></p>
+ followed the <a href="{@docRoot}guide/tutorials/hello-world.html">Hello,
+ World</a> tutorial.</p>
<ol>
<li>
@@ -42,7 +42,7 @@ selections. </em></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="/android/intro/tutorial.html#preparing">setup</a>). Select
+ (downloaded during <a href="{@docRoot}guide/tutorials/notepad/index.html#preparing">setup</a>). Select
<code>Notepadv1</code> and click <strong>Choose</strong>.</li>
<li>
You should see <code>Notepadv1</code> in the <em>Project name</em> and also see the <em>Location</em>
@@ -72,8 +72,8 @@ selections. </em></li>
{@link android.content.ContentProvider ContentProvider}.</p>
<p style="padding-left:.5em;font-size:12px;margin:0;
padding:.0em .5em .5em 1em;">If you are interested, you can find out more about
- <a href="{@docRoot}devel/data/contentproviders.html">content providers</a> or the whole
- subject of <a href="{@docRoot}devel/data.html">Storing, Retrieving, and Exposing Data</a>.
+ <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>
@@ -145,9 +145,9 @@ selections. </em></li>
<p style="padding-left:.5em;font-size:12px;margin:0;
padding:.0em .5em .5em 1em;">Full screen layouts are not the only option for an Activity however. You
might also want to use a <a
-href="{@docRoot}kb/commontasks.html#floatingorfull">floating
+href="{@docRoot}guide/appendix/faq/commontasks.html#floatingorfull">floating
layout</a> (for example, a <a
-href="{@docRoot}kb/commontasks.html#dialogsandalerts">dialog
+href="{@docRoot}guide/appendix/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>
@@ -236,7 +236,7 @@ and
background-color:#FFFFDD;">Resources and the R class</h2>
<p style="padding-left:.5em;font-size:12px;margin:0;
padding:.0em .5em .5em 1em;">The folders under res/ in the Eclipse project are for resources.
- There is a <a href="{@docRoot}kb/commontasks.html#filelist">specific structure</a> to the
+ There is a <a href="{@docRoot}guide/appendix/faq/commontasks.html#filelist">specific structure</a> to the
folders and files under res/.</p>
<p style="padding-left:.5em;font-size:12px;
margin:0; padding:.0em .5em .5em 1em;">Resources defined in these folders and files will have
@@ -330,7 +330,7 @@ Notepadv1
titles:</p>
<ol>
<li>
- In the <code>onCreate</code> method, call <code>super()</code> with the
+ 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>
@@ -376,11 +376,11 @@ Notepadv1
background-color:#FFFFDD;">More on menus</h2>
<p style="padding-left:.5em;font-size:12px;margin:0;
padding:.0em .5em .5em 1em;">The notepad application we are constructing only scratches the
- surface with <a href="{@docRoot}kb/commontasks.html#addmenuitems">menus</a>. </p>
+ surface with <a href="{@docRoot}guide/appendix/faq/commontasks.html#addmenuitems">menus</a>. </p>
<p style="padding-left:.5em;font-size:12px;margin:0;
- padding:.0em .5em .5em 1em;">You can also <a href="{@docRoot}kb/commontasks.html#menukeyshortcuts">add
-shortcut keys for menu items</a>, <a href="{@docRoot}kb/commontasks.html#menukeyshortcuts">create
-submenus</a> and even <a href="{@docRoot}kb/commontasks.html#addingtoothermenus">add
+ padding:.0em .5em .5em 1em;">You can also <a href="{@docRoot}guide/appendix/faq/commontasks.html#menukeyshortcuts">add
+shortcut keys for menu items</a>, <a href="{@docRoot}guide/appendix/faq/commontasks.html#menukeyshortcuts">create
+submenus</a> and even <a href="{@docRoot}guide/appendix/faq/commontasks.html#addingtoothermenus">add
menu items to other applications!</a>. </p>
</div>
@@ -582,7 +582,7 @@ We will simply
from
the zip file to compare with your own.</p>
-<p>Once you are ready, move on to <a href="tutorial-ex2.html">Tutorial
+<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>
-<p><a href="tutorial.html">Back to the Tutorial main page...</a></p>
+<p><a href="index.html">Back to the Tutorial main page...</a></p>
diff --git a/docs/html/guide/tutorials/notepad/notepad-ex2.jd b/docs/html/guide/tutorials/notepad/notepad-ex2.jd
index ce7681b..b4608fb 100644
--- a/docs/html/guide/tutorials/notepad/notepad-ex2.jd
+++ b/docs/html/guide/tutorials/notepad/notepad-ex2.jd
@@ -14,12 +14,12 @@ demonstrates:</em></p>
</ul>
<div style="float:right;white-space:nowrap">
- [<a href="tutorial-ex1.html">Exercise 1</a>]
+ [<a href="notepad-ex1.html">Exercise 1</a>]
<span style="color:#BBB;">
- [<a href="tutorial-ex2.html" style="color:#DDD;">Exercise 2</a>]
+ [<a href="notepad-ex2.html" style="color:#DDD;">Exercise 2</a>]
</span>
- [<a href="tutorial-ex3.html">Exercise 3</a>]
- [<a href="tutorial-extra-credit.html">Extra Credit</a>]
+ [<a href="notepad-ex3.html">Exercise 3</a>]
+ [<a href="notepad-extra-credit.html">Extra Credit</a>]
</div>
<h2>Step 1</h2>
@@ -122,7 +122,7 @@ public boolean onMenuItemSelected(int featureId, MenuItem item) {
<p style="padding-left:.5em;font-size:12px;margin:0;
padding:.0em .5em .5em 1em;">In this example our Intent uses a class name specifically.
As well as
- <a href="{@docRoot}kb/commontasks.html#intentexamples">starting intents</a> in
+ <a href="{@docRoot}guide/appendix/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>
@@ -295,11 +295,11 @@ case ACTIVITY_EDIT:
in real Android applications.</p>
<p style="padding-left:.5em;font-size:12px;margin:0; padding:.0em .5em .5em 1em;">Creating a
good UI is part art and part science, and the rest is work. Mastering <a
- href="{@docRoot}devel/implementing-ui.html">Android layout</a> is an essential part of creating
+ href="{@docRoot}guide/topics/views/declaring-layout.html">Android layout</a> is an essential part of creating
a good looking Android application.</p>
<p style="padding-left:.5em;font-size:12px;margin:0;
padding:.0em .5em .5em 1em;">Take a look at the
- <a href="{@docRoot}reference/view-gallery.html">View Gallery</a>
+ <a href="{@docRoot}guide/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>
@@ -459,7 +459,7 @@ confirmButton.setOnClickListener(new View.OnClickListener() {
</ol>
<h2>Step 10</h2>
-<p>Fill in the body of the <code>onClick()</code> method in our listener.</p>
+<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
@@ -570,7 +570,7 @@ protected void onCreate(Bundle savedInstanceState) {
receive, and more. </p>
<p style="padding-left:.5em;font-size:12px;margin:0;
padding:.0em .5em .5em 1em;">For more information, see the reference document
- <a href="{@docRoot}devel/bblocks-manifest.html">AndroidManifest.xml</a></p>
+ <a href="{@docRoot}guide/topics/manifest/manifest.html">AndroidManifest.xml</a></p>
</div>
<p>Finally, the new Activity has to be defined in the manifest file:</p>
@@ -632,9 +632,9 @@ 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="tutorial-ex3.html">Tutorial
+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>
-<p><a href="tutorial.html">Back to the Tutorial main page...</a>.</p>
+<p><a href="index.html">Back to the Tutorial main page...</a>.</p>
diff --git a/docs/html/guide/tutorials/notepad/notepad-ex3.jd b/docs/html/guide/tutorials/notepad/notepad-ex3.jd
index b42734f..a2eaa48 100644
--- a/docs/html/guide/tutorials/notepad/notepad-ex3.jd
+++ b/docs/html/guide/tutorials/notepad/notepad-ex3.jd
@@ -10,12 +10,12 @@ retrieve application state data. This exercise demonstrates:</em></p>
</ul>
<div style="float:right;white-space:nowrap">
- [<a href="tutorial-ex1.html">Exercise 1</a>]
- [<a href="tutorial-ex2.html">Exercise 2</a>]
+ [<a href="notepad-ex1.html">Exercise 1</a>]
+ [<a href="notepad-ex2.html">Exercise 2</a>]
<span style="color:#BBB;">
- [<a href="tutorial-ex3.html" style="color:#BBB;">Exercise 3</a>]
+ [<a href="notepad-ex3.html" style="color:#BBB;">Exercise 3</a>]
</span>
- [<a href="tutorial-extra-credit.html">Extra Credit</a>]
+ [<a href="notepad-extra-credit.html">Extra Credit</a>]
</div>
<h2>Step 1</h2>
@@ -200,8 +200,8 @@ and populate the View elements with them.</p>
have to store enough state to come back up later, preferably in the same
state it was in when it was killed.</p>
<p style="padding-left:.5em;font-size:12px;margin:0;padding:.0em .5em .5em 1em;">
- Android has a <a href="{@docRoot}intro/lifecycle.html">well-defined life cycle</a>.
- Life-cycle events can happen even if you are not handing off control to
+ Android has a <a href="{@docRoot}guide/topics/fundamentals.html#lcycles">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>
@@ -351,8 +351,7 @@ click menu again)</p>
from
the zip file to compare with your own.</p>
<p>
-When you are ready, move on to the <a href="{@docRoot}intro/tutorial-extra-credit.html">Tutorial
+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>
-<p><a href="{@docRoot}intro/tutorial.html">Back to the Tutorial main
-page...</a></p>
+<p><a href="index.html">Back to the Tutorial main page...</a></p>
diff --git a/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd b/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd
index 9ab84ce..f64e90e 100644
--- a/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd
+++ b/docs/html/guide/tutorials/notepad/notepad-extra-credit.jd
@@ -11,11 +11,11 @@ in Exercise 3. This exercise demonstrates:</em></p>
<div style="float:right;white-space:nowrap">
- [<a href="tutorial-ex1.html">Exercise 1</a>]
- [<a href="tutorial-ex2.html">Exercise 2</a>]
- [<a href="tutorial-ex3.html">Exercise 3</a>]
+ [<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="tutorial-extra-credit.html" style="color:#BBB;">Extra Credit</a>]
+ [<a href="notepad-extra-credit.html" style="color:#BBB;">Extra Credit</a>]
</span>
</div>
@@ -63,8 +63,8 @@ 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}reference/traceview.html">Traceview</a> to profile your application. If your application is running too slow, this can help you
+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
find the bottlenecks and fix them.</p>
-<p><a href="{@docRoot}intro/tutorial.html">Back to the Tutorial main
+<p><a href="index.html">Back to the Tutorial main
page...</a></p>
diff --git a/docs/html/guide/tutorials/views/hello-autocomplete.jd b/docs/html/guide/tutorials/views/hello-autocomplete.jd
index 9f97b32..de3ba29 100644
--- a/docs/html/guide/tutorials/views/hello-autocomplete.jd
+++ b/docs/html/guide/tutorials/views/hello-autocomplete.jd
@@ -1,4 +1,6 @@
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
@@ -111,4 +113,4 @@ static final String[] COUNTRIES = new String[] {
<li>{@link android.widget.AutoCompleteTextView}</li>
</ul>
-<p><a href="{@docRoot}guide/tutorials/views/hello-views-index.html">&larr; Back to Hello Views</a></p>
+
diff --git a/docs/html/guide/tutorials/views/hello-datepicker.jd b/docs/html/guide/tutorials/views/hello-datepicker.jd
index b35d4db..fcd43f3 100644
--- a/docs/html/guide/tutorials/views/hello-datepicker.jd
+++ b/docs/html/guide/tutorials/views/hello-datepicker.jd
@@ -1,4 +1,6 @@
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>
@@ -146,4 +148,4 @@ protected Dialog onCreateDialog(int id) {
<li>{@link android.widget.TextView}</li>
<li>{@link java.util.Calendar}</li>
</ul>
-<p><a href="{@docRoot}guide/tutorials/views/hello-views-index.html">&larr; Back to Hello Views</a></p>
+
diff --git a/docs/html/guide/tutorials/views/hello-formstuff.jd b/docs/html/guide/tutorials/views/hello-formstuff.jd
index 80ae6ce..f858ce3 100644
--- a/docs/html/guide/tutorials/views/hello-formstuff.jd
+++ b/docs/html/guide/tutorials/views/hello-formstuff.jd
@@ -1,4 +1,6 @@
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,
@@ -258,4 +260,3 @@ use <code>setChecked(true)</code> or <code>toggle()</code>. </p>
<li>{@link android.widget.ToggleButton}</li>
</ul>
-<p><a href="{@docRoot}guide/tutorials/views/hello-views-index.html">&larr; Back to Hello Views</a></p>
diff --git a/docs/html/guide/tutorials/views/hello-gallery.jd b/docs/html/guide/tutorials/views/hello-gallery.jd
index af01757..084f912 100644
--- a/docs/html/guide/tutorials/views/hello-gallery.jd
+++ b/docs/html/guide/tutorials/views/hello-gallery.jd
@@ -1,4 +1,6 @@
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
@@ -129,5 +131,5 @@ exactly match the ImageView dimensions.</p>
<li>{@link android.widget.ImageView}</li>
<li>{@link android.widget.Toast}</li>
</ul>
-<p><a href="{@docRoot}guide/tutorials/views/hello-views-index.html">&larr; Back to Hello Views</a></p>
+
diff --git a/docs/html/guide/tutorials/views/hello-gridview.jd b/docs/html/guide/tutorials/views/hello-gridview.jd
index d5c8628..623a03d 100644
--- a/docs/html/guide/tutorials/views/hello-gridview.jd
+++ b/docs/html/guide/tutorials/views/hello-gridview.jd
@@ -1,4 +1,6 @@
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
@@ -124,4 +126,3 @@ public class ImageAdapter extends BaseAdapter {
<li>{@link android.widget.BaseAdapter}</li>
</ul>
-<p><a href="{@docRoot}guide/tutorials/views/hello-views-index.html">&larr; Back to Hello Views</a></p>
diff --git a/docs/html/guide/tutorials/views/hello-linearlayout.jd b/docs/html/guide/tutorials/views/hello-linearlayout.jd
index ecea062..0e8947c 100644
--- a/docs/html/guide/tutorials/views/hello-linearlayout.jd
+++ b/docs/html/guide/tutorials/views/hello-linearlayout.jd
@@ -1,4 +1,6 @@
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
@@ -125,4 +127,4 @@ Pay attention to the effect of the <code>layout_weight</code>. Try
<li>{@link android.widget.TextView}</li>
</ul>
-<p><a href="{@docRoot}guide/tutorials/views/hello-views-index.html">&larr; Back to Hello Views</a></p>
+
diff --git a/docs/html/guide/tutorials/views/hello-listview.jd b/docs/html/guide/tutorials/views/hello-listview.jd
index 41b7f6e..d90005b 100644
--- a/docs/html/guide/tutorials/views/hello-listview.jd
+++ b/docs/html/guide/tutorials/views/hello-listview.jd
@@ -1,4 +1,6 @@
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
@@ -86,4 +88,3 @@ public void onCreate(Bundle savedInstanceState) {
<li>{@link android.widget.ListAdapter}</li>
</ul>
-<p><a href="{@docRoot}guide/tutorials/views/hello-views-index.html">&larr; Back to Hello Views</a></p>
diff --git a/docs/html/guide/tutorials/views/hello-mapview.jd b/docs/html/guide/tutorials/views/hello-mapview.jd
index 5b23f9b..fcdf056 100644
--- a/docs/html/guide/tutorials/views/hello-mapview.jd
+++ b/docs/html/guide/tutorials/views/hello-mapview.jd
@@ -1,4 +1,6 @@
page.title=Hello, MapView
+parent.title=Hello, Views
+parent.link=index.html
@jd:body
<p>A MapView allows you to create your own map-viewing Activity.
@@ -23,23 +25,29 @@ First, we'll create a simple Activity that can view and navigate a map. Then we
android:id="@+id/mainlayout"
android:orientation="vertical"
android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
+ android:layout_height="fill_parent" >
&lt;com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
- android:apiKey="myapikey"
+ android:apiKey="INSERT YOUR KEY HERE"
/>
&lt;RelativeLayout>
</pre>
-
- <p>The <code>android:apiKey</code> should actually contain a legitimate value that's
- associated to your application. For now, it's okay to just leave this as an
- arbitrary string. But to run on 1.0 software, an authentic key will be needed.</p></li>
+ <p>Setting <code>clickable</code> is important. Otherwise, the map does not allow any user interaction.</p>
+
+ <p>The <code>android:apiKey</code> must contain an authentic Android Maps API key.
+ The API key is generated using the MD5 fingerprint of your application certificate. For the purposes of
+ this exercise, you should use the fingerprint of your debug certificate (which cannot be used to release
+ your application for Android devices, but will work while developing). See how to
+ <a href="{@docRoot}guide/topics/geo/mapkey.html#getdebugfingerprint">generate a fingerprint from your
+ debug certificate</a>, then <a href="http://code.google.com/android/maps-api-signup.html">register the
+ certificate</a> to retieve an API key.
+ Insert the API key as the value of the <code>apiKey</code> attribute. If you do not insert a valid
+ Maps API key, the application will still run, but no map tiles will load.</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
@@ -47,7 +55,7 @@ First, we'll create a simple Activity that can view and navigate a map. Then we
<pre>public class HelloMapView extends MapActivity {</pre>
- <li>The <code>isRouteDisplayed()</code> method is requires, so add it inside the class:
+ <li>The <code>isRouteDisplayed()</code> method is required, so add it inside the class:
<pre>
&#64;Override
protected boolean isRouteDisplayed() {
@@ -117,7 +125,7 @@ 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>Right-click the package name in the Eclipse Package Explorer, and select New > Class. Fill-in
+ <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>
@@ -151,7 +159,12 @@ public void addOverlay(OverlayItem overlay) {
<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>return mOverlays.get(i);</pre></li>
+<pre>
+&#64;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:
@@ -185,14 +198,14 @@ HelloItemizedOverlay itemizedOverlay;</pre></li>
new fields:
<pre>
-mapoverlays = mapView.getOverlays();
-drawable = this.getResources().getDrawable(R.drawable.banana);
+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. Our HelloItemizedOverlay takes the Drawable in order to set the
+ 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
@@ -211,7 +224,7 @@ OverlayItem overlayitem = new OverlayItem(point, "", "");</pre>
<pre>
itemizedoverlay.addOverlay(overlayitem);
-mapoverlays.add(itemizedoverlay);</pre></li>
+mapOverlays.add(itemizedoverlay);</pre></li>
<li>Run it!</li>
</ol>
@@ -228,4 +241,3 @@ OverlayItem overlayitem2 = new OverlayItem(point2, "", "");
</pre>
<p>Run it again... We've sent a new droid to Tokyo. Sekai, konichiwa!</p>
-<p><a href="{@docRoot}guide/tutorials/views/hello-views-index.html">&larr; Back to Hello Views</a></p>
diff --git a/docs/html/guide/tutorials/views/hello-relativelayout.jd b/docs/html/guide/tutorials/views/hello-relativelayout.jd
index 4467631..1b91537 100644
--- a/docs/html/guide/tutorials/views/hello-relativelayout.jd
+++ b/docs/html/guide/tutorials/views/hello-relativelayout.jd
@@ -1,4 +1,6 @@
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
@@ -71,7 +73,3 @@ public void onCreate(Bundle savedInstanceState) {
<li>{@link android.widget.EditText}</li>
<li>{@link android.widget.Button}</li>
</ul>
-
-
-<p><a href="{@docRoot}guide/tutorials/views/hello-views-index.html">&larr; Back to Hello Views</a></p>
-
diff --git a/docs/html/guide/tutorials/views/hello-spinner.jd b/docs/html/guide/tutorials/views/hello-spinner.jd
index 4a0f12f..3a04214 100644
--- a/docs/html/guide/tutorials/views/hello-spinner.jd
+++ b/docs/html/guide/tutorials/views/hello-spinner.jd
@@ -1,4 +1,6 @@
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.
@@ -102,4 +104,3 @@ public void onCreate(Bundle savedInstanceState) {
<li>{@link android.widget.Spinner}</li>
</ul>
-<p><a href="{@docRoot}guide/tutorials/views/hello-views-index.html">&larr; Back to Hello Views</a></p>
diff --git a/docs/html/guide/tutorials/views/hello-tablelayout.jd b/docs/html/guide/tutorials/views/hello-tablelayout.jd
index e7f2de5..83d6f5d 100644
--- a/docs/html/guide/tutorials/views/hello-tablelayout.jd
+++ b/docs/html/guide/tutorials/views/hello-tablelayout.jd
@@ -1,4 +1,6 @@
page.title=Hello, TableLayout
+parent.title=Hello, Views
+parent.link=index.html
@jd:body
<p>A {@link android.widget.TableLayout} is a ViewGroup that
@@ -114,6 +116,3 @@ public void onCreate(Bundle savedInstanceState) {
</ul>
-<p><a href="{@docRoot}guide/tutorials/views/hello-views-index.html">&larr; Back to Hello Views</a></p>
-
-
diff --git a/docs/html/guide/tutorials/views/hello-tabwidget.jd b/docs/html/guide/tutorials/views/hello-tabwidget.jd
new file mode 100644
index 0000000..8424616
--- /dev/null
+++ b/docs/html/guide/tutorials/views/hello-tabwidget.jd
@@ -0,0 +1,124 @@
+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>
+&lt;?xml version="1.0" encoding="utf-8"?>
+&lt;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">
+ &lt;LinearLayout
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ &lt;TabWidget
+ android:id="@android:id/tabs"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+ &lt;FrameLayout
+ android:id="@android:id/tabcontent"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ &lt;TextView
+ android:id="@+id/textview1"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:text="this is a tab" />
+ &lt;TextView
+ android:id="@+id/textview2"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:text="this is another tab" />
+ &lt;TextView
+ android:id="@+id/textview3"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:text="this is a third tab" />
+ &lt;/FrameLayout>
+ &lt;/LinearLayout>
+&lt;/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 retireve 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 &mdash; 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>&lt;application></code> tag. It should end up like this:
+ <pre>
+&lt;application android:icon="&#64;drawable/icon" android:theme="&#64;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
index 2faad00..1a6c8f9 100644
--- a/docs/html/guide/tutorials/views/hello-timepicker.jd
+++ b/docs/html/guide/tutorials/views/hello-timepicker.jd
@@ -1,4 +1,6 @@
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
@@ -154,4 +156,4 @@ private static String pad(int c) {
<li>{@link android.widget.TextView}</li>
<li>{@link java.util.Calendar}</li>
</ol>
-<p><a href="{@docRoot}guide/tutorials/views/hello-views-index.html">&larr; Back to Hello Views</a></p>
+
diff --git a/docs/html/guide/tutorials/views/hello-webview.jd b/docs/html/guide/tutorials/views/hello-webview.jd
index 542f91f..c4388ea 100644
--- a/docs/html/guide/tutorials/views/hello-webview.jd
+++ b/docs/html/guide/tutorials/views/hello-webview.jd
@@ -1,4 +1,6 @@
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,
@@ -110,7 +112,6 @@ public boolean onKeyDown(int keyCode, KeyEvent event) {
<li>{@link android.view.KeyEvent}</li>
</ul>
-<p><a href="{@docRoot}guide/tutorials/views/hello-views-index.html">&larr; Back to Hello Views</a></p>
diff --git a/docs/html/guide/tutorials/views/images/hello-tabwidget.png b/docs/html/guide/tutorials/views/images/hello-tabwidget.png
new file mode 100644
index 0000000..6a52356
--- /dev/null
+++ b/docs/html/guide/tutorials/views/images/hello-tabwidget.png
Binary files differ
diff --git a/docs/html/guide/tutorials/views/hello-views-index.jd b/docs/html/guide/tutorials/views/index.jd
index fd00233..6a6ac4b 100644
--- a/docs/html/guide/tutorials/views/hello-views-index.jd
+++ b/docs/html/guide/tutorials/views/index.jd
@@ -3,7 +3,7 @@ page.title=Hello, Views
<style>
.view {float:left; margin:10px; font-size:120%; font-weight:bold;}
-.view img {border:1px solid black; margin-top:5px; padding:5px;}
+.view img {border:1px solid black; margin:5px 0 0; padding:5px;}
</style>
<p>This collection of "Hello World"-style tutorials is designed
@@ -12,7 +12,7 @@ these kinds of boring bits so you can focus on developing the code that makes yo
Of course, we'll discuss some of the given code so that it all makes sense.</p>
<p>Note that a certain amount of knowledge is assumed for these tutorials. If you haven't
-completed the <a href="{@docRoot}guide/tutorials/hello-world.html">Hello World tutorial</a>,
+completed the <a href="{@docRoot}guide/tutorials/hello-world.html">Hello, World</a> tutorial,
please do so&mdash;it will teach you many things you should know about basic
Android development and Eclipse features. More specifically, you should know:</p>
<ul>
@@ -77,6 +77,12 @@ your strings.xml file.</p>
<a href="hello-gallery.html">Gallery<br/>
<img src="images/hello-gallery.png" height="285" width="200" /></a>
</div>
+
+<div class="view">
+<a href="hello-tabwidget.html">TabWidget<br/>
+<img src="images/hello-tabwidget.png" height="285" width="200" /></a>
+</div>
+
<div class="view">
<a href="hello-mapview.html">MapView<br/>
<img src="images/hello-mapview.png" height="285" width="200" /></a>
@@ -106,7 +112,7 @@ ProgressBar; RatingBar; FrameLayout
There are plenty more Views 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}samples/ApiDemos/src/com/example/android/apis/view/index.html">Api Demos</a>.
-These can also be found offline, in <code>/&lt;your-SDK>/samples/ApiDemos</code>.</p>
+<a href="{@docRoot}guide/samples/ApiDemos/src/com/example/android/apis/view/index.html">Api Demos</a>.
+These can also be found offline, in <code>/&lt;sdk&gt;/samples/ApiDemos</code>.</p>
</div>
diff --git a/docs/html/images/activity_lifecycle.png b/docs/html/images/activity_lifecycle.png
index b3e2534..aafe493 100644
--- a/docs/html/images/activity_lifecycle.png
+++ b/docs/html/images/activity_lifecycle.png
Binary files differ
diff --git a/docs/html/images/draw9patch-bad.png b/docs/html/images/draw9patch-bad.png
index 186d9ce9..186d9ce9 100755..100644
--- a/docs/html/images/draw9patch-bad.png
+++ b/docs/html/images/draw9patch-bad.png
Binary files differ
diff --git a/docs/html/images/draw9patch-norm.png b/docs/html/images/draw9patch-norm.png
index 0cba944..0cba944 100755..100644
--- a/docs/html/images/draw9patch-norm.png
+++ b/docs/html/images/draw9patch-norm.png
Binary files differ
diff --git a/docs/html/images/hello_world_9.png b/docs/html/images/hello_world_9.png
index e172e63..3cb4436 100644
--- a/docs/html/images/hello_world_9.png
+++ b/docs/html/images/hello_world_9.png
Binary files differ
diff --git a/docs/html/images/hierarchyviewer-layout.png b/docs/html/images/hierarchyviewer-layout.png
index 217f058..217f058 100755..100644
--- a/docs/html/images/hierarchyviewer-layout.png
+++ b/docs/html/images/hierarchyviewer-layout.png
Binary files differ
diff --git a/docs/html/images/hierarchyviewer-pixelperfect.png b/docs/html/images/hierarchyviewer-pixelperfect.png
index bce3673..bce3673 100755..100644
--- a/docs/html/images/hierarchyviewer-pixelperfect.png
+++ b/docs/html/images/hierarchyviewer-pixelperfect.png
Binary files differ
diff --git a/docs/html/images/layoutparams.png b/docs/html/images/layoutparams.png
index d2f547c..7473dcc 100644
--- a/docs/html/images/layoutparams.png
+++ b/docs/html/images/layoutparams.png
Binary files differ
diff --git a/docs/html/images/mediaplayer_state_diagram.gif b/docs/html/images/mediaplayer_state_diagram.gif
new file mode 100644
index 0000000..f1dcfb5
--- /dev/null
+++ b/docs/html/images/mediaplayer_state_diagram.gif
Binary files differ
diff --git a/docs/html/images/mediarecorder_state_diagram.gif b/docs/html/images/mediarecorder_state_diagram.gif
index 28b8be5..f2a08a7 100644
--- a/docs/html/images/mediarecorder_state_diagram.gif
+++ b/docs/html/images/mediarecorder_state_diagram.gif
Binary files differ
diff --git a/docs/html/images/service_lifecycle.png b/docs/html/images/service_lifecycle.png
new file mode 100644
index 0000000..0748db2
--- /dev/null
+++ b/docs/html/images/service_lifecycle.png
Binary files differ
diff --git a/docs/html/images/zippy_bullet.gif b/docs/html/images/zippy_bullet.gif
index e06601f..e06601f 100755..100644
--- a/docs/html/images/zippy_bullet.gif
+++ b/docs/html/images/zippy_bullet.gif
Binary files differ
diff --git a/docs/html/images/zippy_closed.gif b/docs/html/images/zippy_closed.gif
index 7f25fcd..7f25fcd 100755..100644
--- a/docs/html/images/zippy_closed.gif
+++ b/docs/html/images/zippy_closed.gif
Binary files differ
diff --git a/docs/html/images/zippy_open.gif b/docs/html/images/zippy_open.gif
index e14f0f9..e14f0f9 100755..100644
--- a/docs/html/images/zippy_open.gif
+++ b/docs/html/images/zippy_open.gif
Binary files differ
diff --git a/docs/html/index.jd b/docs/html/index.jd
index e9959a5..05ab987 100644
--- a/docs/html/index.jd
+++ b/docs/html/index.jd
@@ -3,50 +3,31 @@ page.title=Home
@jd:body
-<script type="text/javascript" src="{@docRoot}assets/carousel.js"></script>
-<script type="text/javascript">
- var preview = function() { showPreview('amazonmp3'); };
- addLoadEvent(preview);
-</script>
-
<div id="mainBodyFixed">
<div id="mainBodyLeft">
<div id="homeMiddle">
<div id="homeTitle">
<div style="float:left;">
- <h2>Just Announced: Developer Challenge 2</h2>
+ <h2>T-Mobile G1 Now Available!</h2>
</div>
<div style="float:right;" align="center">
- <a href="{@docRoot}adc/adc2.html">Sign up today!</a><br />
- <img src="{@docRoot}assets/images/icon_robot.jpg" style="padding:8px 10px 8px 10px; clear:both;" />
+ <a href="http://www.t-mobileg1.com">Learn more &raquo;</a><br />
+ <!-- <img src="{@docRoot}assets/images/icon_robot.jpg" style="margin:8px 10px 0 10px; clear:both;" /> -->
</div>
</div><!-- end homeTitle -->
<div id="carouselMain">
- <div id="carouselImg"></div>
- <div id="carouselDesc"></div>
+ <div id="bulletinImg"></div>
+ <div id="bulletinDesc"></div>
</div>
<div class="clearer"></div>
<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">
- <!--ps:app-list-->
- <a id="droidlink-amazonmp3" href="javascript:showPreview('amazonmp3')">
- <img src="{@docRoot}assets/images/amazonmp3-sm.png" alt="Amazon MP3 for Android">
- </a>
- <a id="droidlink-bonsaiblast" href="javascript:showPreview('bonsaiblast')">
- <img src="{@docRoot}assets/images/bonsaiblast-sm.png" alt="Bonsai Blast">
- </a>
- <a id="droidlink-breadcrumbz" href="javascript:showPreview('breadcrumbz')">
- <img src="{@docRoot}assets/images/breadcrumbz-sm.png" alt="BreadCrumbz">
- </a>
- <a id="droidlink-cookingcapsules" href="javascript:showPreview('cookingcapsules')">
- <img src="{@docRoot}assets/images/cookingcapsules-sm.png" alt="Cooking Capsulesâ„¢ Taster">
- </a>
- <!--pe:app-list-->
+ <!-- populated by buildCarousel() -->
</div>
</div><!-- end list-clip -->
- <a href="javascript:page_right()" id="arrow-right" onclick="" class="arrow-right-on"></a>
+ <a href="javascript:{}" id="arrow-right" onclick="" class="arrow-right-off"></a>
<div class="clearer"></div>
</div><!-- end app-list container -->
</div><!-- end homeMiddle -->
@@ -60,7 +41,7 @@ page.title=Home
<br />
<h2>Featured Developer App: BreadCrumbz</h2>
<p>Amos Yoffe takes navigation to the next level with BreadCrumbz.</p>
- <p><a href="http://www.bcrumbz.com">Learn more about this developer &rarr;</a></p>
+ <p><a href="http://www.bcrumbz.com">Learn more about this developer &raquo;</a></p>
</td>
<td>
<img src="{@docRoot}assets/images/logo_breadcrumbz.jpg" />
@@ -73,36 +54,36 @@ page.title=Home
<div id="mainBodyRight">
<table id="rightColumn">
<tr>
- <td class="imageCell"><img src="{@docRoot}assets/images/icon_download.jpg" /></td>
+ <td class="imageCell"><img src="{@docRoot}assets/images/icon_download.jpg" style="padding:0" /></td>
<td>
<h2 class="green">Download</h2>
<p>Latest SDK</p>
- <p><a href="{@docRoot}sdk/">Download now</a></p>
+ <p><a href="{@docRoot}sdk/index.html">Download now</a></p>
</td>
</tr>
<tr>
<td colspan="2"><div class="seperator">&nbsp;</div></td>
</tr>
<tr>
- <td class="imageCell"><img src="{@docRoot}assets/images/icon_market.jpg" /></td>
+ <td class="imageCell"><img src="{@docRoot}assets/images/icon_market.jpg" style="padding:0" /></td>
<td valign="middle"><br /><h2 class="green">Market</h2></td>
</tr>
<tr>
<td colspan="2">
<br />
<p>Android Market is an open service that will give developers the opportunity to distribute applications to handsets.</p>
- <p><a href="http://www.android.com/market.html">Learn more &rarr;</a></p>
+ <p><a href="http://www.android.com/market.html">Learn more &raquo;</a></p>
</td>
</tr>
<tr>
<td colspan="2"><div class="seperator">&nbsp;</div></td>
</tr>
<tr>
- <td class="imageCell"><img src="{@docRoot}assets/images/icon_contribute.jpg" /></td>
+ <td class="imageCell"><img src="{@docRoot}assets/images/icon_contribute.jpg" style="padding:0" /></td>
<td>
<h2 class="green">Contribute</h2>
<p>Create using our open source codebase and help us keep this project growing.</p>
- <p><a href="http://open.android.com">Learn more &rarr;</a></p>
+ <p><a href="http://source.android.com">Learn more &raquo;</a></p>
</td>
</tr>
<tr>
@@ -112,3 +93,65 @@ page.title=Home
</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':"SDK 1.0 r1",
+ 'img':"sdk-large.png",
+ 'title':"Android 1.0 SDK r1",
+ 'desc': "<p>The first Android 1.0 SDK is available for download. This is the first release guaranteed to operate on the first Android devices. If you want to release an application for Android, you should be developing with this SDK.</p><p><a href='{@docRoot}sdk/index.html'>Download Android 1.0 SDK r1</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='{@docRoot}guide/topics/geo/mapkey.html'>Learn how to get a Maps API Key</a></p>"
+ },
+
+ 'market': {
+ 'layout':"imgTop",
+ 'icon':"market-small.png",
+ 'name':"Android Market",
+ 'img':"market-large.png",
+ 'title':"",
+ 'desc': "<p>Android Market helps you get your applications into the hands of users. The beta version of Market is now open and you can begin sharing your applications with users of the first Android-powered phone, the T-Mobile G1.</p><p><a href='http://market.android.com/publish/'>Publish your Android app on Market &raquo;</a></p>"
+ }
+
+ }
+</script>
+<script type="text/javascript" src="{@docRoot}assets/carousel.js"></script>
+<script type="text/javascript">
+ initCarousel("sdk");
+</script>
diff --git a/docs/html/sdk/1.0_r1/RELEASENOTES.jd b/docs/html/sdk/1.0_r1/RELEASENOTES.jd
index bb2e485..c6a38bb 100644
--- a/docs/html/sdk/1.0_r1/RELEASENOTES.jd
+++ b/docs/html/sdk/1.0_r1/RELEASENOTES.jd
@@ -1,11 +1,6 @@
-page.title=Release Notes
+page.title=Release Notes, 1.0 r1
@jd:body
-<p>For the latest known issues, please ensure that you're viewing this page at: <a href="http://code.google.com/android/RELEASENOTES.html">http://code.google.com/android/RELEASENOTES.html</a>.</p>
-
-<a name="1.0_r1"></a>
-
-<h2>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>
@@ -93,264 +88,6 @@ 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 &lt;option&gt</code>)
are not working in this release.</li>
-</ul>
-
-<p>Unless otherwise noted, Known Issues from Android 0.9 SDK also apply to Android 1.0 SDK, Release 1.</p>
-
-
-<a name="0.9_r1" id="0.9_r1"></a>
-
-<h2>Android 0.9 SDK Beta (r1)</h2>
-
-<p>This is the first release of the Android SDK that is formally on the path to Android 1.0. The release is considered beta. (Previous releases were considered early looks at the SDK, and were not formally on the path toward Android 1.0.) This release may not be fully compatible with Android 1.0, when released, meaning that applications you build using this SDK may not run on final Android 1.0 devices.&nbsp; However, the differences between this release and final 1.0-compatible releases are expected to be small.&nbsp; No major API changes are planned.</p>
-
-<p>This beta SDK release contains a large number of bug fixes and improvements from the early-look SDKs.&nbsp; The sections below describe the highlights of the release, but do not provide an exhaustive or comprehensive list of changes.&nbsp; For additional detail, see the <a href="{@docRoot}migrating/m5-0.9/changes-overview.html">API Changes Overview</a>, the <a href="{@docRoot}migrating/m5-0.9/changes.html">API Differences Report</a>, and the main <a href="{@docRoot}documentation.html">SDK documentation</a>.</p>
-
-<p>If you are not viewing this document online at <a href="http://code.google.com/android/RELEASENOTES.html" title="http://code.google.com/android/RELEASENOTES.html">http://code.google.com/android/RELEASENOTES.html</a>, please visit that page to see any additional information added since the SDK was released.</p>
-
-<h3>Installation Notes</h3>
-
-<p>If you've been developing Android applications using the M5 early look of the Android SDK, please see <a href="{@docRoot}intro/upgrading.html">Upgrading the SDK</a> for detailed instructions on how to make the transition to this release.&nbsp; Be sure to wipe emulator data before using the 0.9 beta emulator after using the M3 or M5 emulator.</p>
-
-<p>If you are installing the Android SDK for the first time, please see the instructions in <a href="{@docRoot}intro/installing.html">Installing the SDK</a></p>
-
-<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 &lt;merge&gt; 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 &amp; 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.&nbsp; 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 &lt;project&gt;/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 &lt;merge&gt;, &lt;include&gt;, &lt;ViewStub&gt; 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... &gt; 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 &lt;port&gt;' option and
-specify which port the emulator should bind to for the console. &lt;port&gt; must be an *even* integer between 5554 and 5584 inclusive. The corresponding ADB port will be &lt;port&gt;+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 &lt;fraction&gt;</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}reference/hierarchy-viewer.html">HierarchyViewer</a> is a visual tool for inspecting and debugging your user interfaces and layout. </li>
- <li><a href="{@docRoot}reference/draw9patch.html">Draw 9-patch</a> allows you to easily create a NinePatch graphic using a WYSIWYG editor. </li>
- <li>The <a href="{@docRoot}reference/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.&nbsp; 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.&nbsp;
- </li>
- <li>There are no requirements on the key used to sign .apk files;&nbsp; locally-generated and self-signed keys are allowed.&nbsp; There is no PKI, and developers will not be required to purchase certificates, or similar. &nbsp; For developers who use the Eclipse/ADT plugin, application signing will be largely automatic.&nbsp; 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.&nbsp; 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.&nbsp; 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.&nbsp; 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.&nbsp; 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.&nbsp; 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.&nbsp; 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.&nbsp; 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.&nbsp; 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.&nbsp; (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.&nbsp; 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.&nbsp; 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).
@@ -361,279 +98,3 @@ specify which port the emulator should bind to for the console. &lt;port&gt; mus
</li>
</ul>
-
-
-
-<a name="m5-rc15"></a>
-
-<h2>Version m5-rc15</h2>
-
-<h3>Installation Notes</h3>
-
-<p>If you've already been developing using an m3 or earlier m5 version of the Android SDK, please see <a href="{@docRoot}intro/upgrading.html">Upgrading the SDK</a> for detailed instructions on how to make the transition to m5.</p>
-
-<p>If you're installing the Android SDK for the first time, please see the instructions on <a href="{@docRoot}intro/installing.html">Installing the SDK</a>.</p>
-
-<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>Installation Notes</h3>
-
-<p>If you've already been developing using an m3 version of the Android SDK, please see <a href="{@docRoot}intro/upgrading.html">Upgrading the SDK</a> for detailed instructions on how to make the transition to m5-rc14.</p>
-
-<p>If you're installing the Android SDK for the first time, please see the instructions on <a href="{@docRoot}intro/installing.html">Installing the SDK</a>.</p>
-
-<h3>New Features</h3>
-
-<p>Changes to the Android APIs introduced in m5-rc14 are summarized in <a href="{@docRoot}migrating/m3-to-m5/m5-api-changes.html">this document</a>.</p>
-
-<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}reference/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>Installation Notes</h3>
-
-<h4>ADT Plugin Upgrade Requires Re-Installation of Plugin</h4>
-
-<p>Because of changes in the ADT Plugin and other tools, you will need to uninstall your existing ADT Plugin and then re-install the new version (ADT 0.3.3). For complete information, see <a href="{@docRoot}intro/upgrading.html">Upgrading the SDK</a>. </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 &lt;SDK&gt;/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}reference/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}reference/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>
-...
- &lt;intent-filter&gt;
- &lt;action android:value=&quot;android.intent.action.MAIN&quot; /&gt;
- <strong>&lt;category android:value=&quot;android.intent.category.LAUNCHER&quot; /&gt;</strong>
- &lt;/intent-filter&gt;
-...
-</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 &amp;</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>&lt;JAVADOC&gt;</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/sdk/1.0_r1/download.jd b/docs/html/sdk/1.0_r1/download.jd
deleted file mode 100644
index c767271..0000000
--- a/docs/html/sdk/1.0_r1/download.jd
+++ /dev/null
@@ -1,26 +0,0 @@
-page.title=Download the Android SDK
-@jd:body
-
-<p>Please review the Android SDK License Agreement carefully before
-downloading the SDK. The License Agreement constitutes a contract between you
-and Google with respect to your use of the SDK.</p>
-<iframe src="terms_body.html" style="border: 1px solid black; height:400px; width: 100%; margin: 1em 0;"></iframe>
-<script language="JavaScript">
-function verify() {
- document.getElementById('agreeButton').disabled = !document.getElementById('agreeCheckbox').checked;
-}
-</script>
-<input id="agreeCheckbox" type="checkbox" onclick="verify();"/>I agree to the terms of the SDK License
-<br/><br/>
-<script language="JavaScript">
-function submit() {
- var agreeCheckbox = document.getElementById('agreeCheckbox');
- if (agreeCheckbox.checked) {
- document.location = "download_list.html";
- }
-}
-</script>
-<input id='agreeButton' value="Continue" type="button" onclick="submit();"/>
-<script language="JavaScript">
-document.getElementById('agreeButton').disabled = true;
-</script>
diff --git a/docs/html/sdk/1.0_r1/download_list.jd b/docs/html/sdk/1.0_r1/download_list.jd
deleted file mode 100644
index 6278936..0000000
--- a/docs/html/sdk/1.0_r1/download_list.jd
+++ /dev/null
@@ -1,49 +0,0 @@
-page.title=Download the Android SDK
-@jd:body
-
-<p>Before downloading, please read the <a href="terms.html">Terms</a> that govern your use of the Android SDK.</p>
- <p class="note"><strong>Please note:</strong> The Android SDK is under <b>active development</b>. Please keep this in mind as
- you explore its capabilities. If you discover any issues, we
- welcome you to notify us of them via our
- <a href="http://code.google.com/p/android/issues/list">Issue Tracker</a>.</p>
-
-<p><a href="download_previous.html">Download previous versions</a></p>
-
- <h2>Android 1.0 SDK, Release 1</h2>
- <p><em>September 23, 2008 - <a href="RELEASENOTES.html">Release Notes</a></em></p>
-
- <p class="note"><b>Note:</b> If upgrading from a previous release,
- please read the <a href="intro/upgrading.html">upgrade instructions</a> and
- <a href="migrating/0.9-1.0/changes-overview.html">API changes overview</a>.<br/>
- For a more detailed list of changes, refer to
- the <a href="migrating/0.9-1.0/changes.html">API differences report</a>.</p>
-
-<table>
-<tr>
- <th>Windows</th>
- <th>Mac OS X</th>
- <th>Linux</th>
-</tr>
-<tr>
- <td>SHINY DOWNLOAD BUTTON <br/>94040470 bytes <br/>MD5 checksum:<br/>d69f4ee93d4010f726c04302662fd999</td>
- <td>SHINY DOWNLOAD BUTTON <br/>91733388 bytes <br/>MD5 checksum:<br/>564876ada22872e50c2866806de9fc5c</td>
- <td>SHINY DOWNLOAD BUTTON <br/>92107223 bytes <br/>MD5 checksum:<br/>2660b4029039b7d714e59827e9a9a11d</td>
-</tr>
-</table>
-
- <p>For more information on the SDK:</p>
- <ul>
- <li><a href="intro/installing.html#developmentrequirements">System and Software Requirements</a></li>
- <li><a href="intro/installing.html">Guide to Installing the SDK</a></li>
- </ul>
-
-<h2>Using Eclipse? Install the plugin</h2>
-<p>Android provides an Eclipse plugin to help make programming and debugging
- easier.</p>
-<div class="linkbox"><a href="intro/installing.html#installingplugin">Install the Eclipse plugin</a></div>
-
-
-<h2>Open Source</h2>
-<p>
- Mirrors of open source software used to build the Android SDK are available via the <a href="http://code.google.com/p/android/downloads/list">Android project page</a> hosted on Google Code.
-</p>
diff --git a/docs/html/sdk/1.0_r1/download_previous.jd b/docs/html/sdk/1.0_r1/download_previous.jd
deleted file mode 100644
index 3469746..0000000
--- a/docs/html/sdk/1.0_r1/download_previous.jd
+++ /dev/null
@@ -1,188 +0,0 @@
-page.title=Download the Android SDK - Full Version History
-@jd:body
-
-<p>Before downloading, please read the <a href="terms.html">Terms</a> that govern your use of the Android SDK.</p>
-
-<p><a href="download_list.html">Download the latest version</a></p>
-
- <h2>Android 0.9 SDK beta</h2>
- <p><em>August 18, 2008 - <a href="RELEASENOTES#0.9_beta.html">Release Notes</a></em></p>
- <table>
- <tr>
- <th>Platform</th>
- <th>Package</th>
- <th>Size</th>
- <th>MD5 Checksum</th>
- </tr>
-
- <tr>
- <td>Windows</td>
- <td><a href="http://dl.google.com/android/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="http://dl.google.com/android/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="http://dl.google.com/android/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>
-
-<h2>Version m5-rc15</h2>
- <p><em>March 3, 2008 - <a href="RELEASENOTES.html#m5-rc15">Release Notes</a></em></p>
- <table>
- <tr>
- <th>Platform</th>
- <th>Package</th>
- <th>Size</th>
- <th>MD5 Checksum</th>
- </tr>
- <tr>
- <td>Windows</td>
- <td><a href="http://dl.google.com/android/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="http://dl.google.com/android/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="http://dl.google.com/android/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>
-
-
- <h2>Version m5-rc14</h2>
- <p><em>February 12, 2008 - <a href="RELEASENOTES.html#m5-rc14">Release Notes</a></em></p>
- <table>
- <tr>
- <th>Platform</th>
- <th>Package</th>
- <th>Size</th>
- <th>MD5 Checksum</th>
- </tr>
- <tr>
- <td>Windows</td>
- <td><a href="http://dl.google.com/android/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="http://dl.google.com/android/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="http://dl.google.com/android/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>
-
-
- <h2>Version m3-rc37a</h2>
- <p><em>December 14, 2007 - <a href="RELEASENOTES.html#m3-rc37a">Release Notes</a></em></p>
- <table>
- <tr>
- <th>Platform</th>
- <th>Package</th>
- <th>Size</th>
- <th>MD5 Checksum</th>
- </tr>
- <tr>
- <td>Windows</td>
- <td><a href="http://dl.google.com/android/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="http://dl.google.com/android/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="http://dl.google.com/android/android_sdk_linux_m3-rc37a.zip">android_sdk_linux_m3-rc37a.zip</a></td>
- <td>54 MB</td>
- <td>41285beecc4f9926e6ecf5f12610b356</td>
- </tr>
- </table>
-
-
- <h2>Version m3-rc22a</h2>
- <p><em>November 16, 2007 - <a href="RELEASENOTES.html#m3-rc22a">Release Notes</a></em></p>
- <table>
- <tr>
- <th>Platform</th>
- <th>Package</th>
- <th>Size</th>
- <th>MD5 Checksum</th>
- </tr>
- <tr>
- <td>Windows</td>
- <td><a href="http://dl.google.com/android/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="http://dl.google.com/android/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="http://dl.google.com/android/android_sdk_linux_m3-rc22a.zip">android_sdk_linux_m3-rc22a.zip</a></td>
- <td>55 MB</td>
- <td>84b3455de5cdfd841a172c13d24c382e</td>
- </tr>
- </table>
-
-
- <h2>Version m3-rc20a</h2>
- <p><em>November 12, 2007 - <a href="RELEASENOTES.html#m3-rc20a">Release Notes</a></em></p>
- <table>
- <tr>
- <th>Platform</th>
- <th>Package</th>
- <th>Size</th>
- <th>MD5 Checksum</th>
- </tr>
- <tr>
- <td>Windows</td>
- <td><a href="http://dl.google.com/android/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="http://dl.google.com/android/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="http://dl.google.com/android/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/sdk/1.0_r1/installing.jd b/docs/html/sdk/1.0_r1/installing.jd
index 7eb5d2b..0f15396 100644
--- a/docs/html/sdk/1.0_r1/installing.jd
+++ b/docs/html/sdk/1.0_r1/installing.jd
@@ -3,61 +3,24 @@ page.title=Installing the SDK
<p>This page describes how to install the Android SDK and set up your development environment. If you haven't
-downloaded the SDK yet, you can use the link below to get started. Then read the rest of this document to learn
-how to install, configure, and use the SDK to create Android applications.</p>
+downloaded the SDK yet, follow the link below.</p>
-<div class="linkbox"><a href="http://code.google.com/android/download.html">Download the SDK</a></div>
+<div class="linkbox"><a href="http://developer.android.com/sdk/">Download the SDK</a></div>
-<h4 style="margin-top">Upgrading?</h4>
+<p>Before you begin, be sure that you're development environment meets the SDK
+<a href="requirements.html">System and Software Requirements</a>.</p>
+<div class="special">
+<h4 style="margin-top">Upgrading?</h4>
<p>If you have already developed applications using an earlier version of the
SDK, please skip this page and read the
-<b><a href="{@docRoot}intro/upgrading.html">Upgrading the SDK</a></b> document.
+<b><a href="upgrading.html">Upgrading the SDK</a></b> document.
</p>
+</div>
-<h2 id="developmentrequirements">System and Software Requirements</h2>
-
-<p>To develop Android applications using the code and tools in the Android SDK,
-you need a suitable development computer and development environment, as described below.</p>
-
-<p><strong>Supported Operating Systems:</strong></p>
-<ul>
- <li>Windows XP or Vista</li>
- <li>Mac OS X 10.4.8 or later (x86 only)</li>
- <li>Linux (tested on Linux Ubuntu Dapper Drake)</li>
-</ul>
-
-<p><strong>Supported Development Environments:</strong></p>
-<ul>
- <li>Eclipse IDE
- <ul>
- <li><a href="http://www.eclipse.org/downloads/">Eclipse</a> 3.3 (Europa), 3.4 (Ganymede)
- <ul>
- <li>Eclipse <a href="http://www.eclipse.org/jdt">JDT</a> plugin (included in most Eclipse IDE packages) </li>
- <li><a href="http://www.eclipse.org/webtools">WST</a> (optional, but needed for the Android Editors feature; included in <a href="http://www.eclipse.org/downloads/moreinfo/compare.php">most Eclipse IDE packages</a>)</li>
- </ul>
- </li>
- <li><a href="http://java.sun.com/javase/downloads/index.jsp">JDK 5 or JDK 6</a> (JRE alone is not sufficient)</li>
- <li><a href="installing.html#installingplugin">Android Development Tools plugin</a> (optional)</li>
- <li><strong>Not</strong> compatible with Gnu Compiler for Java (gcj)</li>
- </ul>
- </li>
- <li>Other development environments or IDEs
- <ul>
- <li><a href="http://java.sun.com/javase/downloads/index.jsp">JDK 5 or JDK 6</a> (JRE alone is not sufficient)</li>
- <li><a href="http://ant.apache.org/">Apache Ant</a> 1.6.5 or later for Linux and Mac, 1.7 or later for Windows</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>
-
<a name="installingsdk"></a>
<a name="setup"></a>
-
<h2>Installing the SDK</h2>
<p>After downloading the SDK, unpack the .zip archive to a suitable location on your machine. By default, the SDK files are unpacked into a directory named <code>android_sdk_<em>&lt;platform</em>&gt;_<em>&lt;release&gt;</em>_<em>&lt;build&gt;</em></code>. The directory contains the subdirectories <code>tools/</code>, <code>samples/</code>, and others. </p>
@@ -82,81 +45,12 @@ particular, note that some Linux distributions may include JDK 1.4 or Gnu Compil
dialog that comes up, double-click on Path under System Variables. Add the full path to the <code>tools/</code> directory to the path. </li>
</ul>
- <p>Adding <code>tools</code> to your path lets you run Android Debug Bridge (adb) and the other command line <a href="{@docRoot}intro/tools.html">tools</a> without needing to supply the full path to the tools directory. Note that, if you update your SDK, you should remember to update your PATH settings to point to the new location, if different.</p>
-
-
-<a name="installingplugin"></a>
-
-<h2>Installing the Eclipse Plugin (ADT)</h2>
-
-<p>If you will be using the Eclipse IDE as your environment for developing Android applications, you can install a custom plugin called Android Development Tools (ADT), which adds integrated support for Android projects and tools. The ADT plugin includes a variety of powerful extensions that make creating, running, and debugging Android applications faster and easier.</p>
-
-<p>If you <em>will not</em> be using the Eclipse IDE, you do not need to download or install the ADT plugin.</p>
-
-<p>To download and install the ADT plugin, follow the steps below for your respective Eclipse version. </p>
-
-<table style="font-size:100%">
-<tr><th>Eclipse 3.3 (Europa)</th><th>Eclipse 3.4 (Ganymede)</th></tr>
-<tr>
-<td width="50%">
-<ol>
- <li>Start Eclipse, then select <strong>Help</strong> &gt; <strong>Software Updates</strong> &gt; <strong>Find
- and Install...</strong>. </li>
-
- <li>In the dialog that appears, select <strong>Search for new features to install</strong> and click <strong>Next</strong>. </li>
- <li>Click <strong>New Remote Site</strong>. </li>
- <li>In the resulting dialog box, enter a name for the remote site (e.g. Android Plugin) and enter this as its URL:
- <pre>https://dl-ssl.google.com/android/eclipse/</pre>
-
- Click <strong>OK</strong>. </li>
- <li>You should now see the new site added to the search list (and checked).
- Click <strong>Finish</strong>. </li>
- <li>In the subsequent Search Results dialog box, select the checkbox for
- <strong>Android Plugin</strong> &gt; <strong>Developer Tools</strong>.
- This will check both features: "Android Developer Tools", and "Android
- Editors". The Android Editors feature is optional, but recommended. If
- you choose to install it, you need the WST plugin mentioned earlier in this
- page.<br/>
- Click <strong>Next</strong>. </li>
- <li>Read the license agreement and then select <strong>Accept terms of the license agreement</strong>.
- Click <strong>Next</strong>. </li>
- <li>Click <strong>Finish</strong>. </li>
+ <p>Adding <code>tools</code> to your path lets you run Android Debug Bridge (adb) and the other command line <a href="{@docRoot}guide/developing/tools/index.html">tools</a> without needing to supply the full path to the tools directory. Note that, if you update your SDK, you should remember to update your PATH settings to point to the new location, if different.</p>
- <li>The ADT plugin is not signed; you can accept the installation anyway
- by clicking <strong>Install All</strong>. </li>
- <li>Restart Eclipse. </li>
-</ol>
-
-</td>
-<td>
-
-<ol>
- <li>Start Eclipse, then select <strong>Help</strong> &gt; <strong>Software Updates...</strong>.
- </li>
- <li>In the dialog that appears, click the <strong>Available Software</strong> tab.
- </li>
- <li>Click <strong>Add Site...</strong>
- </li>
- <li>Enter this as the Location:
- <pre>https://dl-ssl.google.com/android/eclipse/</pre>
- Click <strong>OK</strong>. </li>
- <li>Back in the Available Software view, you should see the plugin. Select the checkbox next to
- <em>Developer Tools</em> and click <strong>Install...</strong>
- </li>
- <li>On the subsequent Install window, "Android Developer Tools", and "Android Editors" should both be checked.
- The Android Editors feature is optional, but recommended. If
- you choose to install it, you need the WST plugin mentioned earlier in this
- page.<br/>
- Click <strong>Finish</strong>.
- </li>
- <li>Restart Eclipse. </li>
-</ol>
-
-</td>
-</tr>
-</table>
-
-<p>After restart, <strong>update your Eclipse preferences</strong> to point to the SDK directory:</p>
+<h3>Setting up Eclipse</h3>
+<p>If you'll be developing with the Eclipse IDE, follow the following procedure to setup the IDE
+to use the Android SDK.</p>
+<p>Basically, you just need to update your Eclipse preferences to point to the Android SDK directory:</p>
<ol>
<li>Select <strong>Window</strong> &gt; <strong>Preferences...</strong> to open the Preferences
panel. (Mac OS X: <strong>Eclipse</strong> &gt; <strong>Preferences</strong>) </li>
@@ -164,77 +58,18 @@ particular, note that some Linux distributions may include JDK 1.4 or Gnu Compil
<li>For the SDK Location in the main panel, click <strong>Browse...</strong> and locate the SDK directory. </li>
<li>Click <strong>Apply</strong>, then <strong>OK</strong>.</li>
</ol>
+<p>Done! We now recommend that you install the ADT Eclipse plugin, which will provide some much-appreciated assistance in developing Android apps with Eclipse...</p>
-<h3>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>In Step 4, try changing the remote update site URL to use <code>http</code>, rather than <code>https</code>. </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 3.3/3.4, you can configure proxy information from the main
- Eclipse menu in <strong>Window</strong> (on Mac, <strong>Eclipse</strong>) &gt; <strong>Preferences</strong> &gt; <strong>General</strong> &gt; <strong>Network Connections</strong>.</li>
-</ul>
-<p>
-If you are still unable to use Eclipse to download the ADT plugin, follow these steps to download and install the plugin from your computer:
-</p>
-<ol>
-<li><a href="{@docRoot}adt_download.html">Download the ADT zip file</a> (do not unpack it).
-<li>Follow steps 1 and 2 in the default install instructions (above).
-<li>In Eclipse 3.3, click <strong>New Archive Site...</strong>. <br/>
- In Eclipse 3.4, click <strong>Add Site...</strong>, then <strong>Archive...</strong>
-<li>Browse and select the downloaded the zip file.
-<li>Follow the remaining procedures, above, starting from steps 5.
-</ol>
-<p>
-Note that to update your plugin, you will have to follow these steps again instead of the default update instructions.</p>
-
-
-<p>Note that the "Android Editors" feature of ADT requires several optional
-Eclipse components (for example, WST). If you encounter an error when
-installing ADT, your Eclipse installion might not include those components.
-For information about how to quickly add the necessary components to your
-Eclipse installation, see the troubleshooting topic
-<a href="{@docRoot}kb/troubleshooting.html#installeclipsecomponents">ADT Installation Error: "requires plug-in org.eclipse.wst.sse.ui"</a>.</p>
-
-<a name="Updating_the_ADT_plugin" id="Updating_the_ADT_plugin"></a>
-
-<h3>Updating the ADT Plugin </h3>
+<a name="installingplugin"></a>
+<h2>Installing the Eclipse Plugin (ADT)</h2>
-<p>In some cases, a new ADT plugin may become available for your existing version of the SDK. You can use the steps below to update
-the ADT plugin from inside Eclipse. </p>
+<p>If you will be using the Eclipse IDE as your environment for developing Android applications, you can install a custom plugin called Android Development Tools (ADT), which adds integrated support for Android projects and tools. The ADT plugin includes a variety of powerful extensions that make creating, running, and debugging Android applications faster and easier. This plugin is highly recommended for Eclipse users.</p>
-<table style="font-size:100%">
-<tr><th>Eclipse 3.3 (Europa)</th><th>Eclipse 3.4 (Ganymede)</th></tr>
-<tr>
-<td width="50%">
-<ol>
- <li> Select <strong>Help</strong> &gt; <strong>Software Updates</strong> &gt; <strong>Find and Install...</strong>. </li>
- <li> Select <strong>Search for updates of the currently installed features</strong> and click <strong>Finish</strong>. </li>
- <li> If an update for ADT is available, select and install. </li>
-</ol>
+<p>If you <em>will not</em> be using the Eclipse IDE, you do not need to download or install the ADT plugin.</p>
-<p> Alternatively, </p>
-<ol>
- <li> Select <strong>Help</strong> &gt; <strong>Software Updates</strong> &gt; <strong>Manage Configuration</strong>. </li>
- <li> Navigate down the tree and select <strong>Android Development Tools &lt;version&gt;</strong> </li>
- <li> Select <strong>Scan for Updates</strong> under <strong>Available Tasks</strong>.</li>
-</ol>
-</td>
-<td>
-<ol>
- <li>Select <strong>Help</strong> &gt; <strong>Software Updates...</strong></li>
- <li>Select the <strong>Installed Software</strong> tab.</li>
- <li>Click <strong>Update...</strong></li>
- <li>If an update for ADT is available, select it and click <strong>Finish</strong>.</li>
-</ol>
-</td>
-</tr>
-</table>
+<p><strong>Follow this guide to install the ADT Plugin</strong></p>
<a name="installnotes"></a>
-
<h2>Installation Notes</h2>
<h4>Ubuntu Linux Notes</h4>
<ul>
@@ -265,14 +100,6 @@ and the ADT plugin. </li>
</ul>
<h4>Other Linux Notes</h4>
<ul>
- <li>If you encounter this error when installing the ADT Plugin for
-Eclipse:
- <pre>An error occurred during provisioning.
-Cannot connect to keystore.
-JKS</pre>
- your development machine lacks a suitable Java VM. Installing Sun
-Java 6 will resolve this issue and you can then reinstall the ADT
-Plugin.</li>
<li>If JDK is already installed on your development computer, please
take a moment to make sure that it meets the version requirements listed
at the top of this page. In particular, note that some Linux
diff --git a/docs/html/sdk/1.0_r1/requirements.jd b/docs/html/sdk/1.0_r1/requirements.jd
new file mode 100644
index 0000000..6af3900
--- /dev/null
+++ b/docs/html/sdk/1.0_r1/requirements.jd
@@ -0,0 +1,40 @@
+page.title=System and Software Requirements
+@jd:body
+
+
+<p>To develop Android applications using the code and tools in the Android SDK,
+you need a suitable development computer and development environment, as described below.</p>
+
+<p><strong>Supported Operating Systems:</strong></p>
+<ul>
+ <li>Windows XP or Vista</li>
+ <li>Mac OS X 10.4.8 or later (x86 only)</li>
+ <li>Linux (tested on Linux Ubuntu Dapper Drake)</li>
+</ul>
+
+<p><strong>Supported Development Environments:</strong></p>
+<ul>
+ <li>Eclipse IDE
+ <ul>
+ <li><a href="http://www.eclipse.org/downloads/">Eclipse</a> 3.3 (Europa), 3.4 (Ganymede)
+ <ul>
+ <li>Eclipse <a href="http://www.eclipse.org/jdt">JDT</a> plugin (included in most Eclipse IDE packages) </li>
+ <li><a href="http://www.eclipse.org/webtools">WST</a> (optional, but needed for the Android Editors feature; included in <a href="http://www.eclipse.org/downloads/moreinfo/compare.php">most Eclipse IDE packages</a>)</li>
+ </ul>
+ </li>
+ <li><a href="http://java.sun.com/javase/downloads/index.jsp">JDK 5 or JDK 6</a> (JRE alone is not sufficient)</li>
+ <li><a href="installing.html#installingplugin">Android Development Tools plugin</a> (optional)</li>
+ <li><strong>Not</strong> compatible with Gnu Compiler for Java (gcj)</li>
+ </ul>
+ </li>
+ <li>Other development environments or IDEs
+ <ul>
+ <li><a href="http://java.sun.com/javase/downloads/index.jsp">JDK 5 or JDK 6</a> (JRE alone is not sufficient)</li>
+ <li><a href="http://ant.apache.org/">Apache Ant</a> 1.6.5 or later for Linux and Mac, 1.7 or later for Windows</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> \ No newline at end of file
diff --git a/docs/html/sdk/1.0_r1/sdk_toc.cs b/docs/html/sdk/1.0_r1/sdk_toc.cs
deleted file mode 100644
index 057e037..0000000
--- a/docs/html/sdk/1.0_r1/sdk_toc.cs
+++ /dev/null
@@ -1 +0,0 @@
-<ul> <li><strong><a href="index.html">SDK 1.0</a></strong></li> <ul> <li><a href="installing.html">Installing</a></li> <li><a href="upgrading.html">Upgrading</a></li> <li><a href="terms.html">License Agreement</a></li> <li><a href="RELEASENOTES.html">Release Notes</a></li> </ul> </li> </ul> FIXME \ No newline at end of file
diff --git a/docs/html/sdk/1.0_r1/upgrading.jd b/docs/html/sdk/1.0_r1/upgrading.jd
index 67bcc6a..168f1be 100644
--- a/docs/html/sdk/1.0_r1/upgrading.jd
+++ b/docs/html/sdk/1.0_r1/upgrading.jd
@@ -7,14 +7,14 @@ page.title=Upgrading the SDK
<h2>Useful Links</h2>
<ul class="noindent">
- <li><a href="{@docRoot}migrating/0.9-1.0/changes-overview.html">Overview of Changes</a>
+ <li><a href="migrating/0.9-1.0/changes-overview.html">Overview of Changes</a>
<p>A high-level look at what's changed in Android, with
discussion of how the changes may affect your apps.</p></li>
- <li><a href="{@docRoot}migrating/0.9-1.0/changes.html">API Diff Report</a>
+ <li><a href="migrating/0.9-1.0/changes.html">API Diff Report</a>
<p>A detailed report that lists all the specific changes in the latest SDK.</p></li>
- <li><a href="{@docRoot}RELEASENOTES.html">Release Notes</a>
+ <li><a href="RELEASENOTES.html">Release Notes</a>
<p>Version details, known issues, and resolved issues. </p></li>
<li><a href="http://groups.google.com/group/android-developers">Android Developers Group</a>
@@ -99,7 +99,7 @@ applications to the updated API. The sections below guide you through the proces
the ADT plugin and the Ant-based build tools support this requirement by signing compiled
.apk files with a debug key. To do so, the build tools use the Keytool utility included
in the JDK to to create a keystore and a key with a known alias and password. For more
-information, see <a href="{@docRoot}intro/develop-and-debug.html">Signing Your Applications</a>.
+information, see <a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a>.
<p>To support signing, you should first make sure that Keytool is available to the SDK build
tools. In most cases, you can tell the SDK build tools how to find Keytool by making sure that
@@ -122,7 +122,7 @@ your build.xml file. To do that, follow these steps:</p>
</li>
</ol>
-<p>Run in this way, activityCreator will not erase or create new Java files (or manifest files),
+<p>Run in this way, activitycreator will not erase or create new Java files (or manifest files),
provided the activity and package already exists. It is important that the package and the activity
are real. The tool creates a new build.xml file, as well as a new directory called "libs" in which
to place 3rd jar files, which are now automatically handled by the Ant script.</p>
@@ -130,22 +130,22 @@ to place 3rd jar files, which are now automatically handled by the Ant script.</
<h2 id="migrate">Migrate your applications</h2>
<p>After updating your SDK, you will likely encounter breakages in your code, due to
-framework and API changes. You'll need to update your code to match changes in the Andriod APIs.</p>
+framework and API changes. You'll need to update your code to match changes in the Android APIs.</p>
<p>One way to start is to open your project in Eclipse and see where the ADT
identifies errors in your application. From there, you can lookup
respective changes in the
-<a href="{@docRoot}migrating/0.9-1.0/changes-overview.html">Overview of Changes</a>
-and <a href="{@docRoot}migrating/0.9-1.0/changes.html">API Diffs Report</a>.</p>
+<a href="migrating/changes-overview.html">Overview of Changes</a>
+and <a href="migrating/changes.html">API Diffs Report</a>.</p>
<p>If you have additional trouble updating your code, visit the
-<a href="{@docRoot}groups.html">Android Discussion Groups</a> to seek help from
-other Android developers.</p>
+<a href="http://groups.google.com/group/android-developers">Android Developers Group</a>
+to seek help from other Android developers.</p>
<p>If you have modified one of the ApiDemos applications and would like to migrate it
to the new SDK, note that you will need to uninstall the version of ApiDemos that comes
preinstalled in the emulator. For more information, or if you encounter an "reinstallation"
error when running or installing ApiDemos, see the troubleshooting topic
-<a href="{@docRoot}kb/troubleshooting.html#apidemosreinstall">I can't install ApiDemos
+<a href="{@docRoot}guide/appendix/faq/troubleshooting.html#apidemosreinstall">I can't install ApiDemos
apps in my IDE because of a signing error</a> for information about how to solve the problem.</p>
diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs
index 76421a3..11d3086 100644
--- a/docs/html/sdk/sdk_toc.cs
+++ b/docs/html/sdk/sdk_toc.cs
@@ -1 +1,37 @@
-<ul> <li><h2>SDK 1.0</h2> <ul> <li><strong><a href="<?cs var:toroot ?>sdk/1.0_r1/index.html">Release 1</a></strong> <ul> <li><a href="<?cs var:toroot ?>sdk/1.0_r1/installing.html">Installing</a></li> <li><a href="<?cs var:toroot ?>sdk/1.0_r1/upgrading.html">Upgrading</a></li> <li><a href="<?cs var:toroot ?>sdk/1.0_r1/terms.html">License Agreement</a></li> <li><a href="<?cs var:toroot ?>sdk/1.0_r1/RELEASENOTES.html">Release Notes</a></li> </ul> </li> <!-- <li><strong><a href="<?cs var:toroot ?>sdk/1.0_r2/index.html">Release 2</a></strong> <ul> <li><a href="<?cs var:toroot ?>sdk/1.0_r2/installing.html">Installing</a></li> <li><a href="<?cs var:toroot ?>sdk/1.0_r2/upgrading.html">Upgrading</a></li> <li><a href="<?cs var:toroot ?>sdk/1.0_r2/terms.html">License Agreement</a></li> <li><a href="<?cs var:toroot ?>sdk/1.0_r2/RELEASENOTES.html">Release Notes</a></li> </ul> </li> --> </ul> </li> <!-- just a template <li><h2>SDK 1.1</h2> <ul> <li><strong><a href="<?cs var:toroot ?>sdk/1.1_r1/index.html">Release 1</a></strong> <ul> <li><a href="<?cs var:toroot ?>sdk/1.1_r1/installing.html">Installing</a></li> <li><a href="<?cs var:toroot ?>sdk/1.1_r1/upgrading.html">Upgrading</a></li> <li><a href="<?cs var:toroot ?>sdk/1.1_r1/terms.html">License Agreement</a></li> <li><a href="<?cs var:toroot ?>sdk/1.1_r1/RELEASENOTES.html">Release Notes</a></li> </ul> </li> <li><strong><a href="<?cs var:toroot ?>sdk/1.1_r2/index.html">Release 2</a></strong> <ul> <li><a href="<?cs var:toroot ?>sdk/1.1_r2/installing.html">Installing</a></li> <li><a href="<?cs var:toroot ?>sdk/1.1_r2/upgrading.html">Upgrading</a></li> <li><a href="<?cs var:toroot ?>sdk/1.1_r2/terms.html">License Agreement</a></li> <li><a href="<?cs var:toroot ?>sdk/1.1_r2/RELEASENOTES.html">Release Notes</a></li> </ul> </li> </ul> </li> --> </ul> \ No newline at end of file
+<ul>
+
+ <li><h2>Android 1.0</h2>
+ <ul>
+ <li><strong><a href="<?cs var:toroot ?>sdk/1.0_r1/index.html">Release 1</a></strong>
+ <ul>
+ <li><a href="<?cs var:toroot ?>sdk/1.0_r1/RELEASENOTES.html">Release Notes</a></li>
+ </ul>
+ </li>
+
+ <li><strong><a href="<?cs var:toroot ?>sdk/1.0_r2/index.html">Release 2</a></strong>
+ <ul>
+ <li><a href="<?cs var:toroot ?>sdk/1.0_r2/RELEASENOTES.html">Release Notes</a></li>
+ </ul>
+ </li>
+
+ </ul>
+ </li>
+<!-- just a template
+ <li><h2>Android 1.1</h2>
+ <ul>
+ <li><strong><a href="<?cs var:toroot ?>sdk/1.1_r1/index.html">Release 1</a></strong>
+ <ul>
+ <li><a href="<?cs var:toroot ?>sdk/1.1_r1/RELEASENOTES.html">Release Notes</a></li>
+ </ul>
+ </li>
+ <li><strong><a href="<?cs var:toroot ?>sdk/1.1_r2/index.html">Release 2</a></strong>
+ <ul>
+ <li><a href="<?cs var:toroot ?>sdk/1.1_r2/RELEASENOTES.html">Release Notes</a></li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+-->
+ <li><a href="<?cs var:toroot ?>sdk/terms.html">Terms and Conditions</a></li>
+</ul>
+
diff --git a/docs/html/sdk/1.0_r1/terms_body.html b/docs/html/sdk/terms.jd
index 403593a..5599fa6 100644
--- a/docs/html/sdk/1.0_r1/terms_body.html
+++ b/docs/html/sdk/terms.jd
@@ -1,6 +1,8 @@
-<h1>
- Android Software Development Kit License Agreement
-</h1>
+page.title=Terms and Conditions
+@jd:body
+
+<p>This is the Android Software Development Kit License Agreement.</p>
+
<h2>
1. Introduction
</h2>
diff --git a/docs/html/search.jd b/docs/html/search.jd
index d5e6f92..9269d2c 100755
--- a/docs/html/search.jd
+++ b/docs/html/search.jd
@@ -54,7 +54,7 @@ page.title=Search Results
if (q && q!= "") {
this.leftControl.execute(q);
- document.getElementById("searchTitle").innerHTML = "search results for " + q;
+ document.getElementById("searchTitle").innerHTML = "search results for \"" + q + "\"";
}
return false;
}
@@ -72,10 +72,9 @@ page.title=Search Results
}
google.setOnLoadCallback(OnLoad, true);
</script>
-
-<div id="mainBodyFixed">
- <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>
+ <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>