diff options
Diffstat (limited to 'docs/html')
58 files changed, 1224 insertions, 143 deletions
diff --git a/docs/html/about/versions/android-1.6-highlights.jd b/docs/html/about/versions/android-1.6-highlights.jd index 2ee1d80..edfd7ff 100644 --- a/docs/html/about/versions/android-1.6-highlights.jd +++ b/docs/html/about/versions/android-1.6-highlights.jd @@ -49,17 +49,17 @@ This page provides an overview of some new features and technologies.</p> <!-- screenshots float right --> <div class="screenshot"> -<img src="images/search.png" class="screenshot" alt="" /><br/> +<img src="{@docRoot}sdk/images/search.png" class="screenshot" alt="" /><br/> Quick Search Box </div> <div class="screenshot"> -<img src="images/camera.png" class="screenshot" alt="" /><br/> +<img src="{@docRoot}sdk/images/camera.png" class="screenshot" alt="" /><br/> New Camera/Camcorder UI </div> <div class="screenshot"> -<img src="images/battery.png" class="screenshot" alt="" /><br/> +<img src="{@docRoot}sdk/images/battery.png" class="screenshot" alt="" /><br/> Battery Usage Indicator </div> @@ -121,7 +121,7 @@ on the new accessibility framework and enable them in Settings.</p> <h2 id="GooglePlayUpdates" style="clear:right">Google Play Updates</h2> <div class="screenshot" style="margin-top:-35px"> -<img src="images/market.png" class="screenshot" alt="" /><br/> +<img src="{@docRoot}sdk/images/market.png" class="screenshot" alt="" /><br/> New Google Play UI </div> diff --git a/docs/html/about/versions/android-2.0-highlights.jd b/docs/html/about/versions/android-2.0-highlights.jd index 2ba9ac7..58b5fda 100644 --- a/docs/html/about/versions/android-2.0-highlights.jd +++ b/docs/html/about/versions/android-2.0-highlights.jd @@ -54,27 +54,27 @@ and technologies in Android 2.0.</p> <!-- screenshots float right --> <div class="screenshot"> - <img src="images/2.0/quick-connect.png" class="screenshot" alt="" /><br/> + <img src="{@docRoot}sdk/images/2.0/quick-connect.png" class="screenshot" alt="" /><br/> Quick Contact for Android </div> <div class="screenshot second"> - <img src="images/2.0/multiple-accounts.png" class="screenshot" alt="" /><br/> + <img src="{@docRoot}sdk/images/2.0/multiple-accounts.png" class="screenshot" alt="" /><br/> Multiple Accounts </div> <div class="screenshot"> - <img src="images/2.0/mms-search.png" class="screenshot" alt="" /><br/> + <img src="{@docRoot}sdk/images/2.0/mms-search.png" class="screenshot" alt="" /><br/> Messaging Search </div> <div class="screenshot second"> - <img src="images/2.0/email-inbox.png" class="screenshot" alt="" /><br/> + <img src="{@docRoot}sdk/images/2.0/email-inbox.png" class="screenshot" alt="" /><br/> Email Combined Inbox </div> <div class="screenshot"> - <img src="images/2.0/camera-modes.png" class="screenshot" alt="" /><br/> + <img src="{@docRoot}sdk/images/2.0/camera-modes.png" class="screenshot" alt="" /><br/> Camera Modes </div> diff --git a/docs/html/about/versions/android-2.2-highlights.jd b/docs/html/about/versions/android-2.2-highlights.jd index 37a20d5..190e301 100644 --- a/docs/html/about/versions/android-2.2-highlights.jd +++ b/docs/html/about/versions/android-2.2-highlights.jd @@ -71,7 +71,7 @@ href="android-2.2.html#api">Android 2.2 version notes</a>.</p> <table class="columns" style="max-width:800px"> <tr> <td> -<img src="images/2.2/22home.png" alt="" height=230 /> +<img src="{@docRoot}sdk/images/2.2/22home.png" alt="" height=230 /> </td> <td> <p style="margin-top:0">New Home screen <span class="green">tips widget</span> assists new users on @@ -103,7 +103,7 @@ easily set up and sync an Exchange account (available for Exchange 2007 and high application, enabling users to auto-complete recipient names from the directory.</p> </td> <td> -<img src="images/2.2/22exchange.png" alt="" height=300 /> +<img src="{@docRoot}sdk/images/2.2/22exchange.png" alt="" height=300 /> </td> </tr> </table> @@ -114,7 +114,7 @@ application, enabling users to auto-complete recipient names from the directory. <table class="columns" style="max-width:800px"> <tr> <td> -<img src="images/2.2/22gallery.png" alt="" height=220 /> +<img src="{@docRoot}sdk/images/2.2/22gallery.png" alt="" height=220 /> </td> <td> <p>Gallery allows you to <span class="green">peek into picture stacks</span> using a zoom @@ -141,7 +141,7 @@ connecting their phone to the computer with a USB cable. The connection is then two devices.</p> </td> <td> -<img src="images/2.2/22hotspot.png" alt="" height=180 /> +<img src="{@docRoot}sdk/images/2.2/22hotspot.png" alt="" height=180 /> </td> </tr> </table> @@ -152,7 +152,7 @@ two devices.</p> <table class="columns" style="max-width:800px"> <tr> <td> -<img src="images/2.2/22keyboard.png" alt="" height=220 /> +<img src="{@docRoot}sdk/images/2.2/22keyboard.png" alt="" height=220 /> </td> <td> <p>Multi-lingual users can add multiple languages to the keyboard and <span class="green">switch @@ -179,7 +179,7 @@ faster.</p> which results in faster app switching and smoother performance on memory-constrained devices.</p> </td> <td> -<img src="images/2.2/jit-graph.png" alt="" height=200 /> +<img src="{@docRoot}sdk/images/2.2/jit-graph.png" alt="" height=200 /> </td> </tr> </table> diff --git a/docs/html/about/versions/android-2.2.jd b/docs/html/about/versions/android-2.2.jd index 361e8b6..64ddca4 100644 --- a/docs/html/about/versions/android-2.2.jd +++ b/docs/html/about/versions/android-2.2.jd @@ -1,4 +1,4 @@ -page.title=Android 2.2 Platform +page.title=Android 2.2 APIs sdk.platform.version=2.2 sdk.platform.apiLevel=8 sdk.platform.majorMinor=minor @@ -117,7 +117,7 @@ settings.</p> <p>For more information about setting a preferred install location for your application, including a discussion of what types of applications should and should not request external installation, please read the <a -href="{@docRoot}guide/appendix/install-location.html">App Install Location</a> +href="{@docRoot}guide/topics/data/install-location.html">App Install Location</a> document. </p> <h3 id="backup-manager">Data backup</h3> diff --git a/docs/html/about/versions/android-2.3.3.jd b/docs/html/about/versions/android-2.3.3.jd index 55ff346..7a9711d 100644 --- a/docs/html/about/versions/android-2.3.3.jd +++ b/docs/html/about/versions/android-2.3.3.jd @@ -1,4 +1,4 @@ -page.title=Android 2.3.3 Platform +page.title=Android 2.3.3 APIs sdk.platform.version=2.3.3 sdk.platform.apiLevel=10 @@ -122,8 +122,8 @@ NFC. To request filtering, add <code><uses-feature android:name="android.hardware.nfc" android:required="true"></code> to the application's manifest.</p> -<p class="note">To look at sample code for NFC, see -<a href="{@docRoot}resources/samples/NFCDemo/index.html">NFCDemo app</a>, <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/nfc/TechFilter.html">filtering by tag technology</a></li>, <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/nfc/ForegroundDispatch.html">using foreground dispatch</a>, and <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/nfc/ForegroundNdefPush.html">foreground NDEF push (P2P)</a>.</p> +<p class="note">For more information, read the + <a href="{@docRoot}guide/topics/connectivity/nfc/index.html">NFC</a> developer guide.</p> <h3 id="bluetooth">Bluetooth</h3> diff --git a/docs/html/about/versions/android-2.3.4.jd b/docs/html/about/versions/android-2.3.4.jd index bb4feec..3bb0d7b 100644 --- a/docs/html/about/versions/android-2.3.4.jd +++ b/docs/html/about/versions/android-2.3.4.jd @@ -1,4 +1,4 @@ -page.title=Android 2.3.4 Platform +page.title=Android 2.3.4 APIs sdk.platform.version=2.3.4 sdk.platform.apiLevel=10 diff --git a/docs/html/about/versions/android-2.3.jd b/docs/html/about/versions/android-2.3.jd index 2afa564..8715973 100644 --- a/docs/html/about/versions/android-2.3.jd +++ b/docs/html/about/versions/android-2.3.jd @@ -1,4 +1,4 @@ -page.title=Android 2.3 Platform +page.title=Android 2.3 APIs sdk.platform.version=2.3 sdk.platform.apiLevel=9 @@ -76,8 +76,8 @@ android:name="android.software.sip" android:required="true"></code> and <code><uses-feature android:name="android.software.sip.voip"></code> to the application manifest.</p> -<p class="note">To look at a sample application that uses the SIP API, see <a -href="{@docRoot}resources/samples/SipDemo/index.html">SIP Demo</a>.</p> +<p class="note">For more information, read the <a +href="{@docRoot}guide/topics/connectivity/sip.html">SIP</a> developer guide.</p> <h3 id="nfc">Near Field Communications (NFC)</h3> diff --git a/docs/html/about/versions/android-3.0.jd b/docs/html/about/versions/android-3.0.jd index 76e0795..5bfdffc 100644 --- a/docs/html/about/versions/android-3.0.jd +++ b/docs/html/about/versions/android-3.0.jd @@ -1,4 +1,4 @@ -page.title=Android 3.0 Platform +page.title=Android 3.0 APIs sdk.platform.version=3.0 sdk.platform.apiLevel=11 @jd:body diff --git a/docs/html/about/versions/android-3.1.jd b/docs/html/about/versions/android-3.1.jd index 2a845f0..b0e2f08 100644 --- a/docs/html/about/versions/android-3.1.jd +++ b/docs/html/about/versions/android-3.1.jd @@ -1,4 +1,4 @@ -page.title=Android 3.1 Platform +page.title=Android 3.1 APIs sdk.platform.version=3.1 sdk.platform.apiLevel=12 @jd:body diff --git a/docs/html/about/versions/android-3.2.jd b/docs/html/about/versions/android-3.2.jd index 02111a0..e0f0125 100644 --- a/docs/html/about/versions/android-3.2.jd +++ b/docs/html/about/versions/android-3.2.jd @@ -1,4 +1,4 @@ -page.title=Android 3.2 Platform +page.title=Android 3.2 APIs sdk.platform.version=3.2 sdk.platform.apiLevel=13 @jd:body diff --git a/docs/html/about/versions/android-4.0.3.jd b/docs/html/about/versions/android-4.0.3.jd index a8c7e83..a773b6e 100644 --- a/docs/html/about/versions/android-4.0.3.jd +++ b/docs/html/about/versions/android-4.0.3.jd @@ -1,4 +1,4 @@ -page.title=Android 4.0.3 Platform +page.title=Android 4.0.3 APIs sdk.platform.version=4.0.3 sdk.platform.apiLevel=15 @jd:body diff --git a/docs/html/about/versions/android-4.0.jd b/docs/html/about/versions/android-4.0.jd index 99ab9cb..8595eee 100644 --- a/docs/html/about/versions/android-4.0.jd +++ b/docs/html/about/versions/android-4.0.jd @@ -1,4 +1,4 @@ -page.title=Android 4.0 Platform +page.title=Android 4.0 APIs sdk.platform.version=4.0 sdk.platform.apiLevel=14 @jd:body diff --git a/docs/html/design/design_toc.cs b/docs/html/design/design_toc.cs index 17e08f2..98efa35 100644 --- a/docs/html/design/design_toc.cs +++ b/docs/html/design/design_toc.cs @@ -65,4 +65,8 @@ <div class="nav-section-header empty"><a href="<?cs var:toroot ?>design/downloads/index.html">Downloads</a></div> </li> + <li class="nav-section"> + <div class="nav-section-header empty"><a href="<?cs var:toroot ?>design/extras/index.html">Extras</a></div> + </li> + </ul>
\ No newline at end of file diff --git a/docs/html/design/extras/index.jd b/docs/html/design/extras/index.jd new file mode 100644 index 0000000..4546f75 --- /dev/null +++ b/docs/html/design/extras/index.jd @@ -0,0 +1,22 @@ +page.title=Extras +@jd:body + +<p>The Android Design Team was pleased to present five fantastic design-oriented sessions at Google I/O 2012. Visit these pages to view the videos and presentations from the conference.</p> +<img src="{@docRoot}design/media/extras_googleio_12.png"> + +<h3 id="design-for-success"><a href="https://developers.google.com/events/io/sessions/gooio2012/112/">Android Design for Success</a></h3> +<p>You have a great idea for an Android app. You want it to stand out among hundreds of thousands. You want your users to love it and tell everyone they know. The Android User Experience team is here to help. We talk about the Android Design guide and other tricks of the trade for creating apps that delight users and help them accomplish their goals. No design background is required.</p> + +<h3 id="design-for-engineers"><a href="https://developers.google.com/events/io/sessions/gooio2012/1204/">Android Design for Engineers</a></h3> +<p>Design isn't black magic, it's a field that people can learn. In this talk two elite designers from Google give you an advanced crash course in interactive and visual design. Topics include mental models, natural mappings, metaphors, mode errors, visual hierarchies, typography and gestalt principles. Correctly applied, this knowledge can drastically improve the quality of your work.</p> + +<h3 id="navigation-in-android"><a href="https://developers.google.com/events/io/sessions/gooio2012/114/">Navigation in Android</a></h3> +<p>An app is useless if people can't find their way around it. Android introduced big navigation-support changes in 3.0 and 4.0. The Action Bar offers a convenient control for Up navigation, the Back key's behavior became more consistent within tasks, and the Recent Tasks UI got an overhaul. In this talk, we discuss how and why we got where we are today, how to think about navigation when designing your app's user experience, and how to write apps that offer effortless navigation in multiple Android versions.</p> + +<h3 id="now-what"><a href="https://developers.google.com/events/io/sessions/gooio2012/115/">So You've Read the Design Guide; Now What?</a></h3> +<p>The Android Design Guide describes how to design beautiful Android apps, but not how to build them. In this talk we give practical tips for how to apply fit & finish as you implement your design, we show you how to avoid some common pitfalls, we describe some useful patterns, and show how tools can help.</p> + +<h3 id="playing-with-patterns"><a href="https://developers.google.com/events/io/sessions/gooio2012/131/">Playing with Patterns</a></h3> +<p>Best-in-class application designers and developers talk about their experience in developing for Android, showing screenshots from their app, exploring the challenges they faced, and offering creative solutions congruent with the Android Design guide. Guests are invited to show examples of visual and interaction patterns in their application that manage to keep it simultaneously consistent and personal.</p> + +<p>Videos for the entire Design Track can also be found on the <a href="http://www.youtube.com/playlist?list=PL54FA004D676C3EE9">Android Developers Channel</a> on YouTube.</p>
\ No newline at end of file diff --git a/docs/html/design/media/accessibility_contentdesc.png b/docs/html/design/media/accessibility_contentdesc.png Binary files differindex b4a5c2d..6515711 100644 --- a/docs/html/design/media/accessibility_contentdesc.png +++ b/docs/html/design/media/accessibility_contentdesc.png diff --git a/docs/html/design/media/extras_googleio_12.png b/docs/html/design/media/extras_googleio_12.png Binary files differnew file mode 100644 index 0000000..7ab994d --- /dev/null +++ b/docs/html/design/media/extras_googleio_12.png diff --git a/docs/html/design/patterns/accessibility.jd b/docs/html/design/patterns/accessibility.jd index a41397f..b2fbda9 100644 --- a/docs/html/design/patterns/accessibility.jd +++ b/docs/html/design/patterns/accessibility.jd @@ -31,7 +31,26 @@ page.title=Accessibility <h4>Label visual UI elements meaningfully</h4> <p>In your wireframes, <a href="{@docRoot}guide/topics/ui/accessibility/apps.html#label-ui">label functional UI components</a> that have no visible text. Those components might be buttons, icons, tabs with icons, and icons with state (like stars). Developers can use the <code><a href="{@docRoot}guide/topics/ui/accessibility/apps.html#label-ui">contentDescription</a></code> attribute to set the label.</p> -<img src="{@docRoot}design/media/accessibility_contentdesc.png"> +<div class ="layout-content-row"> + <div class="layout-content-col span-8"> + <img src="{@docRoot}design/media/accessibility_contentdesc.png"> + </div> + <div class="layout-content-col span-5 with-callouts"> + <ol> + <li class="value-1">group</li> + <li class="value-2">all contacts</li> + <li class="value-3">favorites</li> + <li class="value-4">search</li> + <li class="value-5">action overflow button</li> + <li class="value-6"> + <em>when starred:</em> remove from favorites </br> + <em>when not starred:</em> add to favorties</li> + <li class="value-7">action overflow button</li> + <li class="value-8">text message</li> + <li class="value-9">video chat</li> + </ol> + </div> +</div> <h4>Provide alternatives to affordances that time out</h4> <p>Your app may have icons or controls that disappear after a certain amount of time. For example, five seconds after starting a video, playback controls may fade from the screen.</p> diff --git a/docs/html/distribute/googleplay/strategies/app-quality.jd b/docs/html/distribute/googleplay/strategies/app-quality.jd index 26d71d7..6ea862b 100644 --- a/docs/html/distribute/googleplay/strategies/app-quality.jd +++ b/docs/html/distribute/googleplay/strategies/app-quality.jd @@ -67,7 +67,7 @@ You can improve your apps's UI responsiveness by moving long-running operations <p> A great way to improve UI performance is to minimize the complexity of your layouts. If you open up <a href="{@docRoot}tools/help/hierarchy-viewer.html">hierarchyviewer</a> and see that your layouts are more than 5 levels deep, it may be time to simplify your layout. Consider refactoring those deeply nested LinearLayouts into RelativeLayout. The impact of View objects is cumulative — each one costs about 1 to 2 KB of memory, so large view hierarchies can be a recipe for disaster, causing frequent VM garbage collection passes which block the main (UI) thread. You can learn more in <a href="http://www.youtube.com/watch?v=wDBM6wVEO70">World of ListView</a>, another session at Google I/O.</p> <p> -Lastly, pointed out in the blog post <a href="http://android-developers.blogspot.com/2010/10/traceview-war-story.html">Traceview War Story</a>, tools like <a href="{@docRoot}tools/traceview.html">traceview</code> and <a href="{@docRoot}tools/ddms.html">ddms</a> can be your best friends in improving your app by profiling method calls and monitoring VM memory allocations, respectively.</p> +Lastly, pointed out in the blog post <a href="http://android-developers.blogspot.com/2010/10/traceview-war-story.html">Traceview War Story</a>, tools like <a href="{@docRoot}tools/help/traceview.html">traceview</code> and <a href="{@docRoot}tools/help/ddms.html">ddms</a> can be your best friends in improving your app by profiling method calls and monitoring VM memory allocations, respectively.</p> <h2 id="usability">Improve Usability</h2> @@ -93,7 +93,7 @@ Lastly, usability is an extensive and well-documented subject, with close ties t <p> There's no substitute for a real user interface designer — ideally one who's well-versed in mobile and Android, and ideally handy with both interaction and visual design. One popular venue to post openings for designers is <a href="http://jobs.smashingmagazine.com">jobs.smashingmagazine.com</a>, and leveraging social connections on Twitter and LinkedIn can surface great talent.</p> <p> -If you don't have the luxury of working with a UI designer, there are some ways in which you can improve your app's appearance yourself. First, get familiar with Adobe Photoshop, Adobe Fireworks, or some other raster image editing tool. Mastering the art of the pixel in these apps takes time, but honing this skill can help build polish across your interface designs. Also, master the resources framework by studying <a href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=core/res/res;h=a3562fe1af94134486a8a899f02a9c2f7986c8dd;hb=master">the framework UI</a> assets and layouts and reading through the new <a href="{@docRoot}guide/components/resources/available-resources.html">resources documentation</a>. Techniques such as 9-patches and resource directory qualifiers are somewhat unique to Android, and are crucial in building flexible yet aesthetic UIs.</p> +If you don't have the luxury of working with a UI designer, there are some ways in which you can improve your app's appearance yourself. First, get familiar with Adobe Photoshop, Adobe Fireworks, or some other raster image editing tool. Mastering the art of the pixel in these apps takes time, but honing this skill can help build polish across your interface designs. Also, master the resources framework by studying <a href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=core/res/res;h=a3562fe1af94134486a8a899f02a9c2f7986c8dd;hb=master">the framework UI</a> assets and layouts and reading through the new <a href="{@docRoot}guide/topics/resources/index.html">resources documentation</a>. Techniques such as 9-patches and resource directory qualifiers are somewhat unique to Android, and are crucial in building flexible yet aesthetic UIs.</p> <p> Before you get too far in designing your app and writing the code, make sure to visit the Android Design site and learn about the vision, the building blocks, and the tools of designing beautiful and inspiring user interfaces.</p> @@ -105,7 +105,7 @@ Again, listen to your users by collecting and responding to feature requests. Be <h2 id="integrate">Integrate with the System and Third-Party apps</h2> <p> -A great way to deliver a delightful user experience is to integrate tightly with the operating system. Features like <a href="{@docRoot}guide/topics/appwidgets/index.html">Home screen widgets</a>, <a href={@docRoot}design/patterns/notifications.html">rich notifications</a>, <a href="{@docRoot}guide/topics/search/index.html">global search integration</a>, and {@link android.widget.QuickContactBadge Quick Contacts} are fairly low-hanging fruit in this regard. </p> +A great way to deliver a delightful user experience is to integrate tightly with the operating system. Features like <a href="{@docRoot}guide/topics/appwidgets/index.html">Home screen widgets</a>, <a href="{@docRoot}design/patterns/notifications.html">rich notifications</a>, <a href="{@docRoot}guide/topics/search/index.html">global search integration</a>, and {@link android.widget.QuickContactBadge Quick Contacts} are fairly low-hanging fruit in this regard. </p> <p>For some app categories, basic features like home screen widgets are par for the course. Not including them is a sure-fire way to tarnish an otherwise positive user experience. Some apps can achieve even tighter OS integration with Android's contacts, accounts, and sync APIs. </p> <p> diff --git a/docs/html/guide/components/fragments.jd b/docs/html/guide/components/fragments.jd index 4f62033..7747b31 100644 --- a/docs/html/guide/components/fragments.jd +++ b/docs/html/guide/components/fragments.jd @@ -45,17 +45,10 @@ parent.link=activities.html <li>{@link android.app.FragmentManager}</li> <li>{@link android.app.FragmentTransaction}</li> </ol> - - <h2>Related samples</h2> - <ol> - <li><a -href="{@docRoot}resources/samples/HoneycombGallery/index.html">Honeycomb Gallery</a></li> - <li><a -href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/index.html#Fragment">ApiDemos</a></li> - </ol> <h2>See also</h2> <ol> + <li><a href="{@docRoot}training/basics/fragments/index.html">Building a Dynamic UI with Fragments</a></li> <li><a href="{@docRoot}guide/practices/tablets-and-handsets.html">Supporting Tablets and Handsets</a></li> </ol> @@ -834,7 +827,7 @@ then rotates to landscape (which restarts the current activity).</p> <p>For more samples using fragments (and complete source files for this example), -see the sample code available in <a +see the API Demos sample app available in <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/index.html#Fragment"> ApiDemos</a> (available for download from the <a href="{@docRoot}resources/samples/get.html">Samples SDK component</a>).</p> diff --git a/docs/html/guide/components/services.jd b/docs/html/guide/components/services.jd index ba5e1f0..b89914a 100644 --- a/docs/html/guide/components/services.jd +++ b/docs/html/guide/components/services.jd @@ -49,13 +49,6 @@ perform interprocess communication</li> LocalService}</a></li> </ol> -<h2>Articles</h2> -<ol> - <li><a href="{@docRoot}resources/articles/multitasking-android-way.html">Multitasking the Android Way</a></li> - <li><a href="{@docRoot}resources/articles/service-api-changes-starting-with.html">Service API changes starting - with Android 2.0</a></li> -</ol> - <h2>See also</h2> <ol> <li><a href="{@docRoot}guide/components/bound-services.html">Bound Services</a></li> diff --git a/docs/html/guide/google/play/expansion-files.jd b/docs/html/guide/google/play/expansion-files.jd index 62ca1e2..750e958 100644 --- a/docs/html/guide/google/play/expansion-files.jd +++ b/docs/html/guide/google/play/expansion-files.jd @@ -262,7 +262,7 @@ are on the device upon start-up. If the files are not on the device, use Google href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a> service to request URLs for the expansion files, then download and save them. <p>To greatly reduce the amount of code you must write and ensure a good user experience -during the download, we recommend you use the <a href="AboutLibraries">Downloader +during the download, we recommend you use the <a href="#AboutLibraries">Downloader Library</a> to implement your download behavior.</p> <p>If you build your own download service instead of using the library, be aware that you must not change the name of the expansion files and must save them to the proper diff --git a/docs/html/guide/practices/optimizing-for-3.0.jd b/docs/html/guide/practices/optimizing-for-3.0.jd index 65c5674..0dd92d9 100644 --- a/docs/html/guide/practices/optimizing-for-3.0.jd +++ b/docs/html/guide/practices/optimizing-for-3.0.jd @@ -118,7 +118,7 @@ Manager</a> and install the following: <li>Samples for SDK API 11</li> </ul> </li> - <li><a href="{@docRoot}guide/developing/other-ide.html#AVD">Create an AVD</a> for a tablet-type + <li><a href="{@docRoot}tools/devices/managing-avds.html">Create an AVD</a> for a tablet-type device: <p>Set the target to "Android 3.0" and the skin to "WXGA" (the default skin).</p></li> </ol> diff --git a/docs/html/guide/practices/security.jd b/docs/html/guide/practices/security.jd index 48ccdeb..ce59a9d 100644 --- a/docs/html/guide/practices/security.jd +++ b/docs/html/guide/practices/security.jd @@ -134,9 +134,8 @@ dynamic permission grants on a case-by-case basis.</p> <p>To provide additional protection for sensitive data, some applications choose to encrypt local files using a key that is not accessible to the -application. (For example, a key can be placed in a <code><a -href="{@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> and -protected with a user password that is not stored on the device). While this +application. (For example, a key can be placed in a {@link java.security.KeyStore} +and protected with a user password that is not stored on the device). While this does not protect data from a root compromise that can monitor the user inputting the password, it can provide protection for a lost device without <a href="http://source.android.com/tech/encryption/index.html">file system @@ -716,8 +715,7 @@ href="{@docRoot}reference/android/accounts/AccountManager.html"> AccountManager</a></code> using <code><a href="{@docRoot}reference/android/content/pm/PackageManager.html#checkSignatures(java.lang.String,%20java.lang.String)">checkSignature()</a></code>. Alternatively, if only one application will use the credential, you might use a -<code><a -href={@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> for +{@link java.security.KeyStore} for storage.</p> <a name="Crypto"></a> @@ -751,8 +749,8 @@ href="{@docRoot}reference/javax/crypto/KeyGenerator.html"> number generator significantly weakens the strength of the algorithm, and may allow offline attacks.</p> -<p>If you need to store a key for repeated use, use a mechanism like <code><a -href="{@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> that +<p>If you need to store a key for repeated use, use a mechanism like + {@link java.security.KeyStore} that provides a mechanism for long term storage and retrieval of cryptographic keys.</p> diff --git a/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd b/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd index f6c2247..4529797 100644 --- a/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd +++ b/docs/html/guide/practices/ui_guidelines/icon_design_launcher_archive.jd @@ -58,7 +58,7 @@ suggestions on how to work with multiple sets of icons.</p> <h2 id="market">Application Icons on Google Play</h2> -<p>If you are <a href="{@docRoot}tools/publishing/publishing.html">publishing +<p>If you are <a href="{@docRoot}distribute/index.html">publishing your application on Google Play</a>, you will also need to provide a 512x512 pixel, high-resolution application icon in the <a href="http://play.google.com/apps/publish">developer console</a> at upload-time. diff --git a/docs/html/guide/samples/index.html b/docs/html/guide/samples/index.html index f4acdbf..959eaf5 100644 --- a/docs/html/guide/samples/index.html +++ b/docs/html/guide/samples/index.html @@ -1,10 +1,10 @@ <html> <head> -<meta http-equiv="refresh" content="0;url=http://developer.android.com/resources/browser.html?tag=sample"> +<meta http-equiv="refresh" content="0;url=http://developer.android.com/tools/samples/index.html"> <title>Redirecting...</title> </head> <body> <p>You should have been redirected. Please <a -href="http://developer.android.com/resources/browser.html?tag=sample">click here</a>.</p> +href="http://developer.android.com/tools/samples/index.html">click here</a>.</p> </body> </html>
\ No newline at end of file diff --git a/docs/html/guide/topics/data/backup.jd b/docs/html/guide/topics/data/backup.jd index 602b6e8..598b08a 100644 --- a/docs/html/guide/topics/data/backup.jd +++ b/docs/html/guide/topics/data/backup.jd @@ -187,10 +187,7 @@ href="#RestoreVersion">Checking the Restore Data Version</a> for more informatio available only on devices running API Level 8 (Android 2.2) or greater, so you should also set your <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code android:minSdkVersion}</a> -attribute to "8". However, if you implement proper <a -href="{@docRoot}resources/articles/backward-compatibility.html">backward compatibility</a> in -your application, you can support this feature for devices running API Level 8 or greater, while -remaining compatible with older devices.</p> +attribute to "8".</p> diff --git a/docs/html/guide/topics/data/install-location.jd b/docs/html/guide/topics/data/install-location.jd index 19c4b39..5abdced 100644 --- a/docs/html/guide/topics/data/install-location.jd +++ b/docs/html/guide/topics/data/install-location.jd @@ -111,10 +111,7 @@ storage.</p> <p class="caution"><strong>Caution:</strong> Although XML markup such as this will be ignored by older platforms, you must be careful not to use programming APIs introduced in API Level 8 while your {@code minSdkVersion} is less than "8", unless you perform the work necessary to -provide backward compatibility in your code. For information about building -backward compatibility in your application code, see the <a -href="{@docRoot}resources/articles/backward-compatibility.html">Backward Compatibility</a> -article.</p> +provide backward compatibility in your code.</p> @@ -141,17 +138,13 @@ system again. At which time, you can restart your Service.</dd> <dd>Your alarms registered with {@link android.app.AlarmManager} will be cancelled. You must manually re-register any alarms when external storage is remounted.</dd> <dt>Input Method Engines</dt> - <dd>Your <a href="{@docRoot}resources/articles/on-screen-inputs.html">IME</a> will be + <dd>Your <a href="{@docRoot}guide/topics/text/creating-input-method.html">IME</a> will be replaced by the default IME. When external storage is remounted, the user can open system settings to enable your IME again.</dd> <dt>Live Wallpapers</dt> - <dd>Your running <a href="{@docRoot}resources/articles/live-wallpapers.html">Live Wallpaper</a> + <dd>Your running <a href="http://android-developers.blogspot.com/2010/02/live-wallpapers.html">Live Wallpaper</a> will be replaced by the default Live Wallpaper. When external storage is remounted, the user can select your Live Wallpaper again.</dd> - <dt>Live Folders</dt> - <dd>Your <a href="{@docRoot}resources/articles/live-folders.html">Live Folder</a> will be -removed from the home screen. When external storage is remounted, the user can add your Live Folder -to the home screen again.</dd> <dt>App Widgets</dt> <dd>Your <a href="{@docRoot}guide/topics/appwidgets/index.html">App Widget</a> will be removed from the home screen. When external storage is remounted, your App Widget will <em>not</em> be @@ -174,7 +167,7 @@ external storage, it can never receive this broadcast.</dd> <dt>Copy Protection</dt> <dd>Your application cannot be installed to a device's SD card if it uses Google Play's Copy Protection feature. However, if you use Google Play's - <a href="{@docRoot}guide/google/play/licensing.html">Application Licensing</a> instead, your + <a href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a> instead, your application <em>can</em> be installed to internal or external storage, including SD cards.</dd> </dl> diff --git a/docs/html/guide/topics/graphics/opengl.jd b/docs/html/guide/topics/graphics/opengl.jd index a9fedb7..6114a4a 100644 --- a/docs/html/guide/topics/graphics/opengl.jd +++ b/docs/html/guide/topics/graphics/opengl.jd @@ -84,11 +84,8 @@ understanding how to implement these classes in an activity should be your first this class by creating an instance of {@link android.opengl.GLSurfaceView} and adding your {@link android.opengl.GLSurfaceView.Renderer Renderer} to it. However, if you want to capture touch screen events, you should extend the {@link android.opengl.GLSurfaceView} class to - implement the touch listeners, as shown in OpenGL Tutorials for - <a href="{@docRoot}resources/tutorials/opengl/opengl-es10.html#touch">ES 1.0</a>, - <a href="{@docRoot}resources/tutorials/opengl/opengl-es20.html#touch">ES 2.0</a> and the <a -href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/TouchRotateActivity.html" ->TouchRotateActivity</a> sample.</dd> + implement the touch listeners, as shown in OpenGL training lesson, + <a href="{@docRoot}training/graphics/opengl/touch.html">Responding to Touch Events</a>.</dd> <dt><strong>{@link android.opengl.GLSurfaceView.Renderer}</strong></dt> <dd>This interface defines the methods required for drawing graphics in an OpenGL {@link @@ -164,9 +161,8 @@ interface to OpenGL ES 2.0 and is available starting with Android 2.2 (API Level </li> </ul> -<p>If you'd like to start building an app with OpenGL right away, have a look at the tutorials for -<a href="{@docRoot}resources/tutorials/opengl/opengl-es10.html">OpenGL ES 1.0</a> or -<a href="{@docRoot}resources/tutorials/opengl/opengl-es20.html">OpenGL ES 2.0</a>! +<p>If you'd like to start building an app with OpenGL right away, follow the +<a href="{@docRoot}training/graphics/opengl/index.html">Displaying Graphics with OpenGL ES</a> class. </p> <h2 id="manifest">Declaring OpenGL Requirements</h2> @@ -277,10 +273,6 @@ which simulates a camera position. </li> </ol> -<p>For a complete example of how to apply projection and camera views with OpenGL ES 1.0, see the <a -href="{@docRoot}resources/tutorials/opengl/opengl-es10.html#projection-and-views">OpenGL ES 1.0 -tutorial</a>.</p> - <h3 id="proj-es2">Projection and camera view in OpenGL ES 2.0</h3> <p>In the ES 2.0 API, you apply projection and camera view by first adding a matrix member to @@ -382,8 +374,7 @@ objects to be rendered by OpenGL. </li> </ol> <p>For a complete example of how to apply projection and camera view with OpenGL ES 2.0, see the <a -href="{@docRoot}resources/tutorials/opengl/opengl-es20.html#projection-and-views">OpenGL ES 2.0 -tutorial</a>.</p> +href="{@docRoot}training/graphics/opengl/index.html">Displaying Graphics with OpenGL ES</a> class.</p> <h2 id="faces-winding">Shape Faces and Winding</h2> diff --git a/docs/html/guide/topics/manifest/manifest-element.jd b/docs/html/guide/topics/manifest/manifest-element.jd index a3d4a95..4807a5e 100644 --- a/docs/html/guide/topics/manifest/manifest-element.jd +++ b/docs/html/guide/topics/manifest/manifest-element.jd @@ -152,7 +152,7 @@ either internal or external storage through the system settings.</td> <p class="caution"><strong>Caution:</strong> If your application uses Google Play's Copy Protection feature, it cannot be installed to a device's SD card. However, if you use Google - Play's <a href="{@docRoot}guide/google/play/licensing.html">Application Licensing</a> instead, + Play's <a href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a> instead, your application <em>can</em> be installed to internal or external storage, including SD cards.</p> <p class="note"><strong>Note:</strong> By default, your application will be installed on the @@ -175,7 +175,7 @@ multiple SD cards can be used with the same device.</li> storage. However, the system will not allow the user to move the application to external storage if this attribute is set to {@code internalOnly}, which is the default setting.</p> -<p>Read <a href="{@docRoot}guide/appendix/install-location.html">App Install Location</a> for +<p>Read <a href="{@docRoot}guide/topics/data/install-location.html">App Install Location</a> for more information about using this attribute (including how to maintain backward compatibility).</p> <p>Introduced in: API Level 8.</p> diff --git a/docs/html/guide/topics/providers/content-provider-basics.jd b/docs/html/guide/topics/providers/content-provider-basics.jd index 7999033..f5e4805 100644 --- a/docs/html/guide/topics/providers/content-provider-basics.jd +++ b/docs/html/guide/topics/providers/content-provider-basics.jd @@ -1031,11 +1031,11 @@ mRowsDeleted = getContentResolver().delete( <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn"> android:grantUriPermission</a></code> attribute of the - {@code <a href="guide/topics/manifest/provider-element.html"><provider></a>} + {@code <a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a>} element, as well as the - {@code <a href="guide/topics/manifest/grant-uri-permission-element.html"> + {@code <a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html"> <grant-uri-permission></a>} child element of the - {@code <a href="guide/topics/manifest/provider-element.html"><provider></a>} + {@code <a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a>} element. The URI permissions mechanism is explained in more detail in the <a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a> guide, in the section "URI Permissions". diff --git a/docs/html/guide/topics/resources/accessing-resources.jd b/docs/html/guide/topics/resources/accessing-resources.jd index 03bb939..0673b6f 100644 --- a/docs/html/guide/topics/resources/accessing-resources.jd +++ b/docs/html/guide/topics/resources/accessing-resources.jd @@ -336,6 +336,6 @@ android.widget.ArrayAdapter}<String>(this, <strong>android.R.layout.simple <p>In this example, {@link android.R.layout#simple_list_item_1} is a layout resource defined by the platform for items in a {@link android.widget.ListView}. You can use this instead of creating -your own layout for list items. (For more about using {@link android.widget.ListView}, see the -<a href="{@docRoot}resources/tutorials/views/hello-listview.html">List View Tutorial</a>.)</p> +your own layout for list items. For more information, see the +<a href="{@docRoot}guide/topics/ui/layout/listview.html">List View</a> developer guide.</p> diff --git a/docs/html/guide/topics/resources/layout-resource.jd b/docs/html/guide/topics/resources/layout-resource.jd index c653b0c..cd88ae9 100644 --- a/docs/html/guide/topics/resources/layout-resource.jd +++ b/docs/html/guide/topics/resources/layout-resource.jd @@ -169,8 +169,8 @@ root element.</p> <p>Another way to include a layout is to use {@link android.view.ViewStub}. It is a lightweight View that consumes no layout space until you explicitly inflate it, at which point, it includes a layout file defined by its {@code android:layout} attribute. For more information about using {@link -android.view.ViewStub}, read <a href="{@docRoot}resources/articles/layout-tricks-stubs.html">Layout -Tricks: ViewStubs</a>.</p> +android.view.ViewStub}, read <a href="{@docRoot}training/improving-layouts/loading-ondemand.html">Loading + Views On Demand</a>.</p> </dd> <dt id="merge-element"><code><merge></code></dt> @@ -181,8 +181,7 @@ that already contains the appropriate parent View to contain the children of the in another layout file using <a href="#include-element"><code><include></code></a> and this layout doesn't require a different {@link android.view.ViewGroup} container. For more information about merging layouts, read <a -href="{@docRoot}resources/articles/layout-tricks-merge.html">Layout -Tricks: Merging</a>.</dd> +href="{@docRoot}training/improving-layouts/reusing-layouts.html">Re-using Layouts with <include/></a>.</dd> </dl> diff --git a/docs/html/guide/topics/resources/runtime-changes.jd b/docs/html/guide/topics/resources/runtime-changes.jd index f5475b4..5f39aa5 100644 --- a/docs/html/guide/topics/resources/runtime-changes.jd +++ b/docs/html/guide/topics/resources/runtime-changes.jd @@ -16,8 +16,8 @@ parent.link=index.html <ol> <li><a href="providing-resources.html">Providing Resources</a></li> <li><a href="accessing-resources.html">Accessing Resources</a></li> - <li><a href="{@docRoot}resources/articles/faster-screen-orientation-change.html">Faster Screen -Orientation Change</a></li> + <li><a href="http://android-developers.blogspot.com/2009/02/faster-screen-orientation-change.html">Faster + Screen Orientation Change</a></li> </ol> </div> </div> diff --git a/docs/html/guide/topics/security/security.jd b/docs/html/guide/topics/security/security.jd index eeaac44..9cdccae 100644 --- a/docs/html/guide/topics/security/security.jd +++ b/docs/html/guide/topics/security/security.jd @@ -135,8 +135,7 @@ dynamic permission grants on a case-by-case basis.</p> <p>To provide additional protection for sensitive data, some applications choose to encrypt local files using a key that is not accessible to the -application. (For example, a key can be placed in a <code><a -href={@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> and +application. (For example, a key can be placed in a {@link java.security.KeyStore} and protected with a user password that is not stored on the device). While this does not protect data from a root compromise that can monitor the user inputting the password, it can provide protection for a lost device without <a @@ -717,8 +716,7 @@ href="{@docRoot}reference/android/accounts/AccountManager.html"> AccountManager</a></code> using <code><a href="{@docRoot}reference/android/content/pm/PackageManager.html#checkSignatures(java.lang.String,%20java.lang.String)">checkSignature()</a></code>. Alternatively, if only one application will use the credential, you might use a -<code><a -href={@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> for +{@link java.security.KeyStore} for storage.</p> <a name="Crypto"></a> @@ -752,8 +750,7 @@ href="{@docRoot}reference/javax/crypto/KeyGenerator.html"> number generator significantly weakens the strength of the algorithm, and may allow offline attacks.</p> -<p>If you need to store a key for repeated use, use a mechanism like <code><a -href="{@docRoot}reference/java/security/KeyStore.html">KeyStore</a></code> that +<p>If you need to store a key for repeated use, use a mechanism like {@link java.security.KeyStore} that provides a mechanism for long term storage and retrieval of cryptographic keys.</p> diff --git a/docs/html/guide/topics/sensors/index.jd b/docs/html/guide/topics/sensors/index.jd index a045899..726476a 100644 --- a/docs/html/guide/topics/sensors/index.jd +++ b/docs/html/guide/topics/sensors/index.jd @@ -18,7 +18,7 @@ the default position, the screens are wider than they are tall. This introduces issues that we’ve noticed causing problems in some apps.</p> </a> - <a href="android-developers.blogspot.com/2011/06/deep-dive-into-location.html"> + <a href="http://android-developers.blogspot.com/2011/06/deep-dive-into-location.html"> <h4>A Deep Dive Into Location</h4> <p>I’ve written an open-source reference app that incorporates all of the tips, tricks, and cheats I know to reduce the time between opening an app and seeing an up-to-date list of nearby diff --git a/docs/html/guide/topics/sensors/sensors_overview.jd b/docs/html/guide/topics/sensors/sensors_overview.jd index e38a843..a162ccf 100644 --- a/docs/html/guide/topics/sensors/sensors_overview.jd +++ b/docs/html/guide/topics/sensors/sensors_overview.jd @@ -662,7 +662,7 @@ whether there's a pressure sensor on a device:</p> <h4>Using Google Play filters to target specific sensor configurations</h4> <p>If you are publishing your application on Google Play you can use the - <a href="{@docRoot}guide//topics/manifest/uses-feature-element.html"><code><uses-feature> + <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code><uses-feature> </code></a> element in your manifest file to filter your application from devices that do not have the appropriate sensor configuration for your application. The <code><uses-feature></code> element has several hardware descriptors that let you filter diff --git a/docs/html/guide/topics/text/creating-input-method.jd b/docs/html/guide/topics/text/creating-input-method.jd index e49610f..7086824 100644 --- a/docs/html/guide/topics/text/creating-input-method.jd +++ b/docs/html/guide/topics/text/creating-input-method.jd @@ -1,6 +1,5 @@ page.title=Creating an Input Method parent.title=Articles -parent.link=../browser.html?tag=article @jd:body <div id="qv-wrapper"> @@ -162,8 +161,8 @@ parent.link=../browser.html?tag=article In this example, {@code MyKeyboardView} is an instance of a custom implementation of {@link android.inputmethodservice.KeyboardView} that renders a {@link android.inputmethodservice.Keyboard}. If you’re building a traditional QWERTY keyboard, - see the <a href=”{@docRoot}resources/samples/SoftKeyboard/index.html”>Soft Keyboard</a> sample - app for an example of how to extend the {@link android.inputmethodservice.KeyboardView} class. + see the Soft Keyboard <a href="{@docRoot}tools/samples/index.html">sample + app</a> for an example of how to extend the {@link android.inputmethodservice.KeyboardView} class. </p> <h3 id="CandidateView">Candidates view</h3> <p> @@ -175,7 +174,8 @@ parent.link=../browser.html?tag=article default behavior, so you don’t have to implement this if you don’t provide suggestions).</p> <p> For an example implementation that provides user suggestions, see the - <a href=”{@docRoot}resources/samples/SoftKeyboard/index.html”>Soft Keyboard</a> sample app. + Soft Keyboard <a href="{@docRoot}tools/samples/index.html">sample + app</a>. </p> <h3 id="DesignConsiderations">UI design considerations</h3> <p> @@ -388,8 +388,8 @@ The input type bit pattern can have one of several values, including: To intercept hardware keys, override {@link android.inputmethodservice.InputMethodService#onKeyDown(int, KeyEvent) onKeyDown()} and {@link android.inputmethodservice.InputMethodService#onKeyUp(int, KeyEvent) onKeyUp()}. - See the <a href=”{@docRoot}resources/samples/SoftKeyboard/index.html”>Soft Keyboard</a> sample - app for an example. + See the Soft Keyboard <a href="{@docRoot}tools/samples/index.html">sample + app</a> for an example. </p> <p> Remember to call the <code>super()</code> method for keys you don't want to handle yourself. diff --git a/docs/html/guide/topics/text/spell-checker-framework.jd b/docs/html/guide/topics/text/spell-checker-framework.jd index 1c2e211..7f7a0b8 100644 --- a/docs/html/guide/topics/text/spell-checker-framework.jd +++ b/docs/html/guide/topics/text/spell-checker-framework.jd @@ -1,6 +1,5 @@ page.title=Spelling Checker Framework parent.title=Articles -parent.link=../browser.html?tag=article @jd:body <div id="qv-wrapper"> <div id="qv"> diff --git a/docs/html/guide/topics/ui/accessibility/services.jd b/docs/html/guide/topics/ui/accessibility/services.jd index 0c1d065..7d36181 100644 --- a/docs/html/guide/topics/ui/accessibility/services.jd +++ b/docs/html/guide/topics/ui/accessibility/services.jd @@ -10,7 +10,7 @@ parent.link=index.html <ol> <li><a href="#manifest">Manifest Declarations and Permissions</a> <ol> - <li><a href="service-declaration">Accessibility service declaration</a></li> + <li><a href="#service-declaration">Accessibility service declaration</a></li> <li><a href="#service-config">Accessibility service configuration</a></li> </ol> </li> diff --git a/docs/html/guide/topics/ui/layout/relative.jd b/docs/html/guide/topics/ui/layout/relative.jd index ee6cf02..47f9417 100644 --- a/docs/html/guide/topics/ui/layout/relative.jd +++ b/docs/html/guide/topics/ui/layout/relative.jd @@ -44,19 +44,19 @@ android.widget.RelativeLayout.LayoutParams}.</p> include:</p> <dl> <dt><a -href="{docRoot}reference/android/widget/RelativeLayout.LayoutParams.html#attr_android:layout_alignParentTop" +href="{@docRoot}reference/android/widget/RelativeLayout.LayoutParams.html#attr_android:layout_alignParentTop" >{@code android:layout_alignParentTop}</a></dt> <dd>If {@code "true"}, makes the top edge of this view match the top edge of the parent. </dd> <dt><a -href="{docRoot}reference/android/widget/RelativeLayout.LayoutParams.html#attr_android:layout_centerVertical" +href="{@docRoot}reference/android/widget/RelativeLayout.LayoutParams.html#attr_android:layout_centerVertical" >{@code android:layout_centerVertical}</a></dt> <dd>If {@code "true"}, centers this child vertically within its parent.</dd> <dt><a -href="{docRoot}reference/android/widget/RelativeLayout.LayoutParams.html#attr_android:layout_below" +href="{@docRoot}reference/android/widget/RelativeLayout.LayoutParams.html#attr_android:layout_below" >{@code android:layout_below}</a></dt> <dd>Positions the top edge of this view below the view specified with a resource ID.</dd> <dt><a -href="{docRoot}reference/android/widget/RelativeLayout.LayoutParams.html#attr_android:layout_toRightOf" +href="{@docRoot}reference/android/widget/RelativeLayout.LayoutParams.html#attr_android:layout_toRightOf" >{@code android:layout_toRightOf}</a></dt> <dd>Positions the left edge of this view to the right of the view specified with a resource ID.</dd> </dl> diff --git a/docs/html/shareables/training/nsdchat.zip b/docs/html/shareables/training/nsdchat.zip Binary files differnew file mode 100644 index 0000000..a106975 --- /dev/null +++ b/docs/html/shareables/training/nsdchat.zip diff --git a/docs/html/tools/adk/aoa2.jd b/docs/html/tools/adk/aoa2.jd index 2a3b2f0..bbccfc3 100644 --- a/docs/html/tools/adk/aoa2.jd +++ b/docs/html/tools/adk/aoa2.jd @@ -20,7 +20,7 @@ page.title=Android Open Accessory Protocol 2.0 </div> <p>This document describes the changes to the Android Open Accessory (AOA) protocol since its -initial release, and is a supplement to the documentation of the <a href="oap.html">first +initial release, and is a supplement to the documentation of the <a href="aoa.html">first release of AOA</a>.</p> <p>The Android Open Accessory Protocol 2.0 adds two new features: audio output (from the Android diff --git a/docs/html/tools/help/gltracer.jd b/docs/html/tools/help/gltracer.jd index 35c405e..700ee39 100644 --- a/docs/html/tools/help/gltracer.jd +++ b/docs/html/tools/help/gltracer.jd @@ -5,9 +5,9 @@ page.title=Tracer for OpenGL ES <div id="qv"> <h2>In this document</h2> <ol> - <li><a href="running">Running Tracer</a></li> - <li><a href="generating">Generating a Trace</a></li> - <li><a href="analyzing">Analyzing a Trace</a></li> + <li><a href="#running">Running Tracer</a></li> + <li><a href="#generating">Generating a Trace</a></li> + <li><a href="#analyzing">Analyzing a Trace</a></li> </ol> <h2>See also</h2> <ol> diff --git a/docs/html/tools/revisions/platforms.jd b/docs/html/tools/revisions/platforms.jd index 6163fbc..62ec422 100644 --- a/docs/html/tools/revisions/platforms.jd +++ b/docs/html/tools/revisions/platforms.jd @@ -870,7 +870,7 @@ class="toggle-content-img" alt="" />Android {@sdkPlatformVersion}, Revision 1</a <dt>Tools:</dt> <dd> -<p>Adds support for building with Android library projects. See <a href="tools-notes.html">SDK +<p>Adds support for building with Android library projects. See <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools, r6</a> for information.</p> </dd> diff --git a/docs/html/tools/sdk/installing.jd b/docs/html/tools/sdk/installing.jd index 126d992..d7f1957 100644 --- a/docs/html/tools/sdk/installing.jd +++ b/docs/html/tools/sdk/installing.jd @@ -375,7 +375,7 @@ devices. </td> <td colspan="3"><code>docs/</code></td> <td>A full set of documentation in HTML format, including the Developer's Guide, API Reference, and other information. To read the documentation, load the -file <code>offline.html</code> in a web browser.</td> +file <code>index.html</code> in a web browser.</td> </tr> <tr> <td colspan="3"><code>platform-tools/</code></td> diff --git a/docs/html/training/accessibility/service.jd b/docs/html/training/accessibility/service.jd index f62506b..80ecbc7 100644 --- a/docs/html/training/accessibility/service.jd +++ b/docs/html/training/accessibility/service.jd @@ -281,6 +281,6 @@ public void onAccessibilityEvent(AccessibilityEvent event) { <p>Now you have a complete, functioning accessibility service. Try configuring how it interacts with the user, by adding Android's <a - href="http://developer.android.com/resources/articles/tts.html">text-to-speech + href="http://android-developers.blogspot.com/2009/09/introduction-to-text-to-speech-in.html">text-to-speech engine</a>, or using a {@link android.os.Vibrator} to provide haptic feedback!</p> diff --git a/docs/html/training/basics/network-ops/connecting.jd b/docs/html/training/basics/network-ops/connecting.jd index f70cf58..ac8d993 100644 --- a/docs/html/training/basics/network-ops/connecting.jd +++ b/docs/html/training/basics/network-ops/connecting.jd @@ -66,7 +66,7 @@ and {@link android.net.NetworkInfo#isConnected isConnected()}. Remember, the device may be out of range of a network, or the user may have disabled both Wi-Fi and mobile data access. For more discussion of this topic, see the lesson <a -href="{@docRoot}training/network-ops/managing.html">Managing Network +href="{@docRoot}training/basics/network-ops/managing.html">Managing Network Usage</a>.</p> <pre> diff --git a/docs/html/training/connect-devices-wirelessly/index.jd b/docs/html/training/connect-devices-wirelessly/index.jd new file mode 100644 index 0000000..37cf633 --- /dev/null +++ b/docs/html/training/connect-devices-wirelessly/index.jd @@ -0,0 +1,62 @@ +page.title=Connecting Devices Wirelessly + +trainingnavtop=true +startpage=true +next.title=Using Network Service Discovery +next.link=nsd.html + +@jd:body + + +<div id="tb-wrapper"> +<div id="tb"> + +<h2>Dependencies and prerequisites</h2> +<ul> + <li>Android 4.1 or higher</li> +</ul> + +<h2>You should also read</h2> +<ul> + <li><a href="{@docRoot}guide/topics/connectivity/wifip2p.html">Wi-Fi Direct</a></li> +</ul> + + +</div> +</div> + + +<p>Besides enabling communication with the cloud, Android's wireless APIs also +enable communication with other devices on the same local network, and even +devices which are not on a network, but are physically nearby. The addition of +Network Service Discovery (NSD) takes this further by allowing an application to +seek out a nearby device running services with which it can communicate. +Integrating this functionality into your application helps you provide a wide range +of features, such as playing games with users in the same room, pulling +images from a networked NSD-enabled webcam, or remotely logging into +other machines on the same network.</p> +<p>This class describes the key APIs for finding and +connecting to other devices from your application. Specifically, it +describes the NSD API for discovering available services and the Wi-Fi +Direct™ API for doing peer-to-peer wireless connections. This class also +shows you how to use NSD and Wi-Fi Direct in +combination to detect the services offered by a device and connect to the +device when neither device is connected to a network. +</p> +<h2>Lessons</h2> + +<dl> + <dt><strong><a href="nsd.html">Using Network Service Discovery</a></strong></dt> + <dd>Learn how to broadcast services offered by your own application, discover + services offered on the local network, and use NSD to determine the connection + details for the service you wish to connect to.</dd> + <dt><strong><a href="wifi-direct.html">Connecting with Wi-Fi Direct</a></strong></dt> + <dd>Learn how to fetch a list of nearby peer devices, create an access point + for legacy devices, and connect to other devices capable of Wi-Fi Direct + connections.</dd> + <dt><strong><a href="nsd-wifi-direct.html">Using Wi-Fi Direct for Service + Discovery</a></strong></dt> + <dd>Learn how to discover services published by nearby devices without being + on the same network, using Wi-Fi Direct.</dd> +</dl> + diff --git a/docs/html/training/connect-devices-wirelessly/nsd-wifi-direct.jd b/docs/html/training/connect-devices-wirelessly/nsd-wifi-direct.jd new file mode 100644 index 0000000..5e276de --- /dev/null +++ b/docs/html/training/connect-devices-wirelessly/nsd-wifi-direct.jd @@ -0,0 +1,252 @@ +page.title=Using Wi-Fi Direct for Service Discovery +parent.title=Connecting Devices Wirelessly +parent.link=index.html + +trainingnavtop=true + +@jd:body + +<div id="tb-wrapper"> + <div id="tb"> + <h2>This lesson teaches you to</h2> + <ol> + <li><a href="#manifest">Set Up the Manifest</a></li> + <li><a href="#register">Add a Local Service</a></li> + <li><a href="#discover">Discover Nearby Services</a></li> + </ol> + <!-- + <h2>You should also read</h2> + <ul> + <li><a href="#"></a></li> + </ul> + --> + </div> +</div> + +<p>The first lesson in this class, <a href="nsd.html">Using Network Service + Discovery</a>, showed you +how to discover services that are connected to a local network. However, using +Wi-Fi Direct&trad; Service Discovery allows you to discover the services of nearby devices directly, +without being connected to a network. You can also advertise the services +running on your device. These capabilities help you communicate between apps, +even when no local network or hotspot is available.</p> +<p>While this set of APIs is similar in purpose to the Network Service Discovery +APIs outlined in a previous lesson, implementing them in code is very different. +This lesson shows you how to discover services available from other devices, +using Wi-Fi Direct™. The lesson assumes that you're already familiar with the +<a href="{@docRoot}guide/topics/connectivity/wifip2p.html">Wi-Fi Direct</a> API.</p> + + +<h2 id="manifest">Set Up the Manifest</h2> +<p>In order to use Wi-Fi Direct, add the {@link +android.Manifest.permission#CHANGE_WIFI_STATE}, {@link +android.Manifest.permission#ACCESS_WIFI_STATE}, +and {@link android.Manifest.permission#INTERNET} +permissions to your manifest. Even though Wi-Fi Direct doesn't require an +Internet connection, it uses standard Java sockets, and using these in Android +requires the requested permissions.</p> + +<pre> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.example.android.nsdchat" + ... + + <uses-permission + android:required="true" + android:name="android.permission.ACCESS_WIFI_STATE"/> + <uses-permission + android:required="true" + android:name="android.permission.CHANGE_WIFI_STATE"/> + <uses-permission + android:required="true" + android:name="android.permission.INTERNET"/> + ... +</pre> + +<h2 id="register">Add a Local Service</h2> +<p>If you're providing a local service, you need to register it for +service discovery. Once your local service is registered, the framework +automatically responds to service discovery requests from peers.</p> + +<p>To create a local service:</p> + +<ol> + <li>Create a +{@link android.net.wifi.p2p.nsd.WifiP2pServiceInfo} object.</li> + <li>Populate it with information about your service.</li> + <li>Call {@link +android.net.wifi.p2p.WifiP2pManager#addLocalService(WifiP2pManager.Channel, +WifiP2pServiceInfo, WifiP2pManager.ActionListener) addLocalService()} to register the local +service for service discovery.</li> +</ol> + +<pre> + private void startRegistration() { + // Create a string map containing information about your service. + Map<String,String> record = new HashMap<String,String>(); + record.put("listenport", String.valueOf(SERVER_PORT)); + record.put("buddyname", "John Doe" + (int) (Math.random() * 1000)); + record.put("available", "visible"); + + // Service information. Pass it an instance name, service type + // _protocol._transportlayer , and the map containing + // information other devices will want once they connect to this one. + WifiP2pDnsSdServiceInfo serviceInfo = + WifiP2pDnsSdServiceInfo.newInstance("_test", "_presence._tcp", record); + + // Add the local service, sending the service info, network channel, + // and listener that will be used to indicate success or failure of + // the request. + mManager.addLocalService(channel, serviceInfo, new ActionListener() { + @Override + public void onSuccess() { + // Command successful! Code isn't necessarily needed here, + // Unless you want to update the UI or add logging statements. + } + + @Override + public void onFailure(int arg0) { + // Command failed. Check for P2P_UNSUPPORTED, ERROR, or BUSY + } + }); + } +</pre> + +<h2 id="discover">Discover Nearby Services</h2> +<p>Android uses callback methods to notify your application of available services, so +the first thing to do is set those up. Create a {@link +android.net.wifi.p2p.WifiP2pManager.DnsSdTxtRecordListener} to listen for +incoming records. This record can optionally be broadcast by other +devices. When one comes in, copy the device address and any other +relevant information you want into a data structure external to the current +method, so you can access it later. The following example assumes that the +record contains a "buddyname" field, populated with the user's identity.</p> + +<pre> +final HashMap<String, String> buddies = new HashMap<String, String>(); +... +private void discoverService() { + DnsSdTxtRecordListener txtListener = new DnsSdTxtRecordListener() { + @Override + /* Callback includes: + * fullDomain: full domain name: e.g "printer._ipp._tcp.local." + * record: TXT record dta as a map of key/value pairs. + * device: The device running the advertised service. + */ + + public void onDnsSdTxtRecordAvailable( + String fullDomain, Map<String,String> record, WifiP2pDevice device) { + Log.d(TAG, "DnsSdTxtRecord available -" + record.toString()); + buddies.put(device.deviceAddress, record.get("buddyname")); + } + }; + ... +} +</pre> + +<p>To get the service information, create a {@link +android.net.wifi.p2p.WifiP2pManager.DnsSdServiceResponseListener}. This +receives the actual description and connection information. The previous code +snippet implemented a {@link java.util.Map} object to pair a device address with the buddy +name. The service response listener uses this to link the DNS record with the +corresponding service information. Once both +listeners are implemented, add them to the {@link +android.net.wifi.p2p.WifiP2pManager} using the {@link +android.net.wifi.p2p.WifiP2pManager#setDnsSdResponseListeners(WifiP2pManager.Channel, +WifiP2pManager.DnsSdServiceResponseListener, +WifiP2pManager.DnsSdTxtRecordListener) setDnsSdResponseListeners()} method.</p> + +<pre> +private void discoverService() { +... + + DnsSdServiceResponseListener servListener = new DnsSdServiceResponseListener() { + @Override + public void onDnsSdServiceAvailable(String instanceName, String registrationType, + WifiP2pDevice resourceType) { + + // Update the device name with the human-friendly version from + // the DnsTxtRecord, assuming one arrived. + resourceType.deviceName = buddies + .containsKey(resourceType.deviceAddress) ? buddies + .get(resourceType.deviceAddress) : resourceType.deviceName; + + // Add to the custom adapter defined specifically for showing + // wifi devices. + WiFiDirectServicesList fragment = (WiFiDirectServicesList) getFragmentManager() + .findFragmentById(R.id.frag_peerlist); + WiFiDevicesAdapter adapter = ((WiFiDevicesAdapter) fragment + .getListAdapter()); + + adapter.add(resourceType); + adapter.notifyDataSetChanged(); + Log.d(TAG, "onBonjourServiceAvailable " + instanceName); + } + }; + + mManager.setDnsSdResponseListeners(channel, servListener, txtListener); + ... +} +</pre> + +<p>Now create a service request and call {@link +android.net.wifi.p2p.WifiP2pManager#addServiceRequest(WifiP2pManager.Channel, +WifiP2pServiceRequest, WifiP2pManager.ActionListener) addServiceRequest()}. +This method also takes a listener to report success or failure.</p> + +<pre> + serviceRequest = WifiP2pDnsSdServiceRequest.newInstance(); + mManager.addServiceRequest(channel, + serviceRequest, + new ActionListener() { + @Override + public void onSuccess() { + // Success! + } + + @Override + public void onFailure(int code) { + // Command failed. Check for P2P_UNSUPPORTED, ERROR, or BUSY + } + }); +</pre> + +<p>Finally, make the call to {@link +android.net.wifi.p2p.WifiP2pManager#discoverServices(WifiP2pManager.Channel, +WifiP2pManager.ActionListener) discoverServices()}.</p> + +<pre> + mManager.discoverServices(channel, new ActionListener() { + + @Override + public void onSuccess() { + // Success! + } + + @Override + public void onFailure(int code) { + // Command failed. Check for P2P_UNSUPPORTED, ERROR, or BUSY + if (code == WifiP2pManager.P2P_UNSUPPORTED) { + Log.d(TAG, "P2P isn't supported on this device."); + else if(...) + ... + } + }); +</pre> + +<p>If all goes well, hooray, you're done! If you encounter problems, remember +that the asynchronous calls you've made take an +{@link android.net.wifi.p2p.WifiP2pManager.ActionListener} as an argument, and +this provides you with callbacks indicating success or failure. To diagnose +problems, put debugging code in {@link +android.net.wifi.p2p.WifiP2pManager.ActionListener#onFailure(int) onFailure()}. The error code +provided by the method hints at the problem. Here are the possible error values +and what they mean</p> +<dl> + <dt> {@link android.net.wifi.p2p.WifiP2pManager#P2P_UNSUPPORTED}</dt> + <dd> Wi-Fi Direct isn't supported on the device running the app.</dd> + <dt> {@link android.net.wifi.p2p.WifiP2pManager#BUSY}</dt> + <dd> The system is to busy to process the request.</dd> + <dt> {@link android.net.wifi.p2p.WifiP2pManager#ERROR}</dt> + <dd> The operation failed due to an internal error.</dd> +</dl> diff --git a/docs/html/training/connect-devices-wirelessly/nsd.jd b/docs/html/training/connect-devices-wirelessly/nsd.jd new file mode 100644 index 0000000..d2b01a1 --- /dev/null +++ b/docs/html/training/connect-devices-wirelessly/nsd.jd @@ -0,0 +1,373 @@ +page.title=Using Network Service Discovery +parent.title=Connecting Devices Wirelessly +parent.link=index.html + +trainingnavtop=true +next.title=Connecting with Wi-Fi Direct +next.link=wifi-direct.html + +@jd:body + +<div id="tb-wrapper"> +<div id="tb"> + +<!-- table of contents --> +<h2>This lesson teaches you how to</h2> +<ol> + <li><a href="#register">Register Your Service on the Network</a></li> + <li><a href="#discover">Discover Services on the Network</a></li> + <li><a href="#connect">Connect to Services on the Network</a></li> + <li><a href="#teardown">Unregister Your Service on Application Close</a></li> +</ol> + +<!-- +<h2>You should also read</h2> + <ul> + </ul> +--> +<h2>Try it out</h2> + +<div class="download-box"> + <a href="{@docRoot}shareables/training/nsdchat.zip" class="button">Download + the sample app</a> + <p class="filename">nsdchat.zip</p> +</div> +</p> + +</div> +</div> + +<p>Adding Network Service Discovery (NSD) to your app allows your users to +identify other devices on the local network that support the services your app +requests. This is useful for a variety of peer-to-peer applications such as file +sharing or multi-player gaming. Android's NSD APIs simplify the effort required +for you to implement such features.</p> + +<p>This lesson shows you how to build an application that can broadcast its +name and connection information to the local network and scan for information +from other applications doing the same. Finally, this lesson shows you how +to connect to the same application running on another device.</p> + +<h2 id="register">Register Your Service on the Network</h2> + +<p class="note"><strong>Note: </strong>This step is optional. If +you don't care about broadcasting your app's services over the local network, +you can skip forward to the +next section, <a href="#discover">Discover Services on the Network</a>.</p> + +<p>To register your service on the local network, first create a {@link +android.net.nsd.NsdServiceInfo} object. This object provides the information +that other devices on the network use when they're deciding whether to connect to your +service. </p> + +<pre> +public void registerService(int port) { + // Create the NsdServiceInfo object, and populate it. + NsdServiceInfo serviceInfo = new NsdServiceInfo(); + + // The name is subject to change based on conflicts + // with other services advertised on the same network. + serviceInfo.setServiceName("NsdChat"); + serviceInfo.setServiceType("_http._tcp."); + serviceInfo.setPort(port); + .... +} +</pre> + +<p>This code snippet sets the service name to "NsdChat". +The name is visible to any device on the network that is using NSD to look for +local services. Keep in mind that the name must be unique for any service on the +network, and Android automatically handles conflict resolution. If +two devices on the network both have the NsdChat application installed, one of +them changes the service name automatically, to something like "NsdChat +(1)".</p> + +<p>The second parameter sets the service type, specifies which protocol and transport +layer the application uses. The syntax is +"_<protocol>._<transportlayer>". In the +code snippet, the service uses HTTP protocol running over TCP. An application +offering a printer service (for instance, a network printer) would set the +service type to "_ipp._tcp".</p> + +<p class="note"><strong>Note: </strong> The International Assigned Numbers +Authority (IANA) manages a centralized, +authoritative list of service types used by service discovery protocols such as NSD and Bonjour. +You can download the list from <a + href="http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml">the +IANA list of service names and port numbers</a>. +If you intend to use a new service type, you should reserve it by filling out +the <a + href="http://www.iana.org/form/ports-services">IANA Ports and Service + registration form</a>.</p> + +<p>When setting the port for your service, avoid hardcoding it as this +conflicts with other applications. For instance, assuming +that your application always uses port 1337 puts it in potential conflict with +other installed applications that use the same port. Instead, use the device's +next available port. Because this information is provided to other apps by a +service broadcast, there's no need for the port your application uses to be +known by other applications at compile-time. Instead, the applications can get +this information from your service broadcast, right before connecting to your +service.</p> + +<p>If you're working with sockets, here's how you can initialize a socket to any +available port simply by setting it to 0.</p> + +<pre> +public void initializeServerSocket() { + // Initialize a server socket on the next available port. + mServerSocket = new ServerSocket(0); + + // Store the chosen port. + mLocalPort = mServerSocket.getLocalPort(); + ... +} +</pre> + +<p>Now that you've defined the {@link android.net.nsd.NsdServiceInfo +NsdServiceInfo} object, you need to implement the {@link +android.net.nsd.NsdManager.RegistrationListener RegistrationListener} interface. This +interface contains callbacks used by Android to alert your application of the +success or failure of service registration and unregistration. +</p> +<pre> +public void initializeRegistrationListener() { + mRegistrationListener = new NsdManager.RegistrationListener() { + + @Override + public void onServiceRegistered(NsdServiceInfo NsdServiceInfo) { + // Save the service name. Android may have changed it in order to + // resolve a conflict, so update the name you initially requested + // with the name Android actually used. + mServiceName = NsdServiceInfo.getServiceName(); + } + + @Override + public void onRegistrationFailed(NsdServiceInfo serviceInfo, int errorCode) { + // Registration failed! Put debugging code here to determine why. + } + + @Override + public void onServiceUnregistered(NsdServiceInfo arg0) { + // Service has been unregistered. This only happens when you call + // NsdManager.unregisterService() and pass in this listener. + } + + @Override + public void onUnregistrationFailed(NsdServiceInfo serviceInfo, int errorCode) { + // Unregistration failed. Put debugging code here to determine why. + } + }; +} +</pre> + +<p>Now you have all the pieces to register your service. Call the method +{@link android.net.nsd.NsdManager#registerService registerService()}. +</p> + +<p>Note that this method is asynchronous, so any code that needs to run +after the service has been registered must go in the {@link +android.net.nsd.NsdManager.RegistrationListener#onServiceRegistered(NsdServiceInfo) +onServiceRegistered()} method.</p> + +<pre> +public void registerService(int port) { + NsdServiceInfo serviceInfo = new NsdServiceInfo(); + serviceInfo.setServiceName("NsdChat"); + serviceInfo.setServiceType("_http._tcp."); + serviceInfo.setPort(port); + + mNsdManager = Context.getSystemService(Context.NSD_SERVICE); + + mNsdManager.registerService( + serviceInfo, NsdManager.PROTOCOL_DNS_SD, mRegistrationListener); +} +</pre> + +<h2 id="discover">Discover Services on the Network</h2> +<p>The network is teeming with life, from the beastly network printers to the +docile network webcams, to the brutal, fiery battles of nearby tic-tac-toe +players. The key to letting your application see this vibrant ecosystem of +functionality is service discovery. Your application needs to listen to service +broadcasts on the network to see what services are available, and filter out +anything the application can't work with.</p> + +<p>Service discovery, like service registration, has two steps: + setting up a discovery listener with the relevant callbacks, and making a single asynchronous +API call to {@link android.net.nsd.NsdManager#discoverServices(String +, int , NsdManager.DiscoveryListener) discoverServices()}.</p> + +<p>First, instantiate an anonymous class that implements {@link +android.net.nsd.NsdManager.DiscoveryListener}. The following snippet shows a +simple example:</p> + +<pre> +public void initializeDiscoveryListener() { + + // Instantiate a new DiscoveryListener + mDiscoveryListener = new NsdManager.DiscoveryListener() { + + // Called as soon as service discovery begins. + @Override + public void onDiscoveryStarted(String regType) { + Log.d(TAG, "Service discovery started"); + } + + @Override + public void onServiceFound(NsdServiceInfo service) { + // A service was found! Do something with it. + Log.d(TAG, "Service discovery success" + service); + if (!service.getServiceType().equals(SERVICE_TYPE)) { + // Service type is the string containing the protocol and + // transport layer for this service. + Log.d(TAG, "Unknown Service Type: " + service.getServiceType()); + } else if (service.getServiceName().equals(mServiceName)) { + // The name of the service tells the user what they'd be + // connecting to. It could be "Bob's Chat App". + Log.d(TAG, "Same machine: " + mServiceName); + } else if (service.getServiceName().contains("NsdChat")){ + mNsdManager.resolveService(service, mResolveListener); + } + } + + @Override + public void onServiceLost(NsdServiceInfo service) { + // When the network service is no longer available. + // Internal bookkeeping code goes here. + Log.e(TAG, "service lost" + service); + } + + @Override + public void onDiscoveryStopped(String serviceType) { + Log.i(TAG, "Discovery stopped: " + serviceType); + } + + @Override + public void onStartDiscoveryFailed(String serviceType, int errorCode) { + Log.e(TAG, "Discovery failed: Error code:" + errorCode); + mNsdManager.stopServiceDiscovery(this); + } + + @Override + public void onStopDiscoveryFailed(String serviceType, int errorCode) { + Log.e(TAG, "Discovery failed: Error code:" + errorCode); + mNsdManager.stopServiceDiscovery(this); + } + }; +} +</pre> + +<p>The NSD API uses the methods in this interface to inform your application when discovery +is started, when it fails, and when services are found and lost (lost means "is +no longer available"). Notice that this snippet does several checks +when a service is found.</p> +<ol> + <li>The service name of the found service is compared to the service +name of the local service to determine if the device just picked up its own +broadcast (which is valid).</li> +<li>The service type is checked, to verify it's a type of service your +application can connect to.</li> +<li>The service name is checked to verify connection to the correct +application.</li> +</ol> + +<p>Checking the service name isn't always necessary, and is only relevant if you +want to connect to a specific application. For instance, the application might +only want to connect to instances of itself running on other devices. However, if the +application wants to connect to a network printer, it's enough to see that the service type +is "_ipp._tcp".</p> + +<p>After setting up the listener, call {@link android.net.nsd.NsdManager#discoverServices(String, int, +NsdManager.DiscoveryListener) discoverServices()}, passing in the service type +your application should look for, the discovery protocol to use, and the +listener you just created.</p> + +<pre> + mNsdManager.discoverServices( + SERVICE_TYPE, NsdManager.PROTOCOL_DNS_SD, mDiscoveryListener); +</pre> + + +<h2 id="connect">Connect to Services on the Network</h2> +<p>When your application finds a service on the network to connect to, it +must first determine the connection information for that service, using the +{@link android.net.nsd.NsdManager#resolveService resolveService()} method. +Implement a {@link android.net.nsd.NsdManager.ResolveListener} to pass into this +method, and use it to get a {@link android.net.nsd.NsdServiceInfo} containing +the connection information.</p> + +<pre> +public void initializeResolveListener() { + mResolveListener = new NsdManager.ResolveListener() { + + @Override + public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode) { + // Called when the resolve fails. Use the error code to debug. + Log.e(TAG, "Resolve failed" + errorCode); + } + + @Override + public void onServiceResolved(NsdServiceInfo serviceInfo) { + Log.e(TAG, "Resolve Succeeded. " + serviceInfo); + + if (serviceInfo.getServiceName().equals(mServiceName)) { + Log.d(TAG, "Same IP."); + return; + } + mService = serviceInfo; + int port = mService.getPort(); + InetAddress host = mService.getHost(); + } + }; +} +</pre> + +<p>Once the service is resolved, your application receives detailed +service information including an IP address and port number. This is everything +you need to create your own network connection to the service.</p> + + +<h2 id="teardown">Unregister Your Service on Application Close</h2> +<p>It's important to enable and disable NSD +functionality as appropriate during the application's +lifecycle. Unregistering your application when it closes down helps prevent +other applications from thinking it's still active and attempting to connect to +it. Also, service discovery is an expensive operation, and should be stopped +when the parent Activity is paused, and re-enabled when the Activity is +resumed. Override the lifecycle methods of your main Activity and insert code +to start and stop service broadcast and discovery as appropriate.</p> + +<pre> +//In your application's Activity + + @Override + protected void onPause() { + if (mNsdHelper != null) { + mNsdHelper.tearDown(); + } + super.onPause(); + } + + @Override + protected void onResume() { + super.onResume(); + if (mNsdHelper != null) { + mNsdHelper.registerService(mConnection.getLocalPort()); + mNsdHelper.discoverServices(); + } + } + + @Override + protected void onDestroy() { + mNsdHelper.tearDown(); + mConnection.tearDown(); + super.onDestroy(); + } + + // NsdHelper's tearDown method + public void tearDown() { + mNsdManager.unregisterService(mRegistrationListener); + mNsdManager.stopServiceDiscovery(mDiscoveryListener); + } +</pre> + diff --git a/docs/html/training/connect-devices-wirelessly/wifi-direct.jd b/docs/html/training/connect-devices-wirelessly/wifi-direct.jd new file mode 100644 index 0000000..99bb243 --- /dev/null +++ b/docs/html/training/connect-devices-wirelessly/wifi-direct.jd @@ -0,0 +1,372 @@ +page.title=Connecting with Wi-Fi Direct +parent.title=Connecting Devices Wirelessly +parent.link=index.html + +trainingnavtop=true +previous.title=Using Network Service Discovery +previous.link=nsd.html +next.title=Service Discovery with Wi-Fi Direct +next.link=nsd-wifi-direct.html + +@jd:body + +<div id="tb-wrapper"> + <div id="tb"> + <h2>This lesson teaches you how to</h2> + <ol> + <li><a href="#permissions">Set Up Application Permissions</a></li> + <li><a href="#receiver">Set Up the Broadcast Receiver and Peer-to-Peer + Manager</a></li> + <li><a href="#discover">Initiate Peer Discovery</a></li> + <li><a href="#fetch">Fetch the List of Peers</a></li> + <li><a href="#connect">Connect to a Peer</a></li> + </ol> + </div> +</div> + +<p>The Wi-Fi Direct™ APIs allow applications to connect to nearby devices without +needing to connect to a network or hotspot. This allows your application to quickly +find and interact with nearby devices, at a range beyond the capabilities of Bluetooth. +</p> +<p> +This lesson shows you how to find and connect to nearby devices using Wi-Fi Direct. +</p> +<h2 id="permissions">Set Up Application Permissions</h2> +<p>In order to use Wi-Fi Direct, add the {@link +android.Manifest.permission#CHANGE_WIFI_STATE}, {@link +android.Manifest.permission#ACCESS_WIFI_STATE}, +and {@link android.Manifest.permission#INTERNET} +permissions to your manifest. Wi-Fi Direct doesn't require an internet connection, +but it does use standard Java sockets, which require the {@link +android.Manifest.permission#INTERNET} permission. +So you need the following permissions to use Wi-Fi Direct.</p> + +<pre> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.example.android.nsdchat" + ... + + <uses-permission + android:required="true" + android:name="android.permission.ACCESS_WIFI_STATE"/> + <uses-permission + android:required="true" + android:name="android.permission.CHANGE_WIFI_STATE"/> + <uses-permission + android:required="true" + android:name="android.permission.INTERNET"/> + ... +</pre> + +<h2 id="receiver">Set Up a Broadcast Receiver and Peer-to-Peer Manager</h2> +<p>To use Wi-Fi Direct, you need to listen for broadcast intents that tell your +application when certain events have occurred. In your application, instantiate +an {@link +android.content.IntentFilter} and set it to listen for the following:</p> +<dl> + <dt>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_CHANGED_ACTION}</dt> + <dd>Indicates whether Wi-Fi Peer-To-Peer (P2P) is enabled</dd> + <dt>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_PEERS_CHANGED_ACTION}</dt> + <dd>Indicates that the available peer list has changed.</dd> + <dt>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_CONNECTION_CHANGED_ACTION}</dt> + <dd>Indicates the state of Wi-Fi P2P connectivity has changed.</dd> + <dt>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_THIS_DEVICE_CHANGED_ACTION}</dt> + <dd>Indicates this device's configuration details have changed.</dd> +<pre> +private final IntentFilter intentFilter = new IntentFilter(); +... +@Override +public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + + // Indicates a change in the Wi-Fi Peer-to-Peer status. + intentFilter.addAction(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION); + + // Indicates a change in the list of available peers. + intentFilter.addAction(WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION); + + // Indicates the state of Wi-Fi P2P connectivity has changed. + intentFilter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION); + + // Indicates this device's details have changed. + intentFilter.addAction(WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION); + + ... +} +</pre> + + <p>At the end of the {@link android.app.Activity#onCreate onCreate()} method, get an instance of the {@link +android.net.wifi.p2p.WifiP2pManager}, and call its {@link +android.net.wifi.p2p.WifiP2pManager#initialize(Context, Looper, WifiP2pManager.ChannelListener) initialize()} +method. This method returns a {@link +android.net.wifi.p2p.WifiP2pManager.Channel} object, which you'll use later to +connect your app to the Wi-Fi Direct Framework.</p> + +<pre> +@Override + +Channel mChannel; + +public void onCreate(Bundle savedInstanceState) { + .... + mManager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE); + mChannel = mManager.initialize(this, getMainLooper(), null); +} +</pre> +<p>Now create a new {@link +android.content.BroadcastReceiver} class that you'll use to listen for changes +to the System's Wi-Fi P2P state. In the {@link +android.content.BroadcastReceiver#onReceive(Context, Intent) onReceive()} +method, add a condition to handle each P2P state change listed above.</p> + +<pre> + + @Override + public void onReceive(Context context, Intent intent) { + String action = intent.getAction(); + if (WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION.equals(action)) { + // Determine if Wifi Direct mode is enabled or not, alert + // the Activity. + int state = intent.getIntExtra(WifiP2pManager.EXTRA_WIFI_STATE, -1); + if (state == WifiP2pManager.WIFI_P2P_STATE_ENABLED) { + activity.setIsWifiP2pEnabled(true); + } else { + activity.setIsWifiP2pEnabled(false); + } + } else if (WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION.equals(action)) { + + // The peer list has changed! We should probably do something about + // that. + + } else if (WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION.equals(action)) { + + // Connection state changed! We should probably do something about + // that. + + } else if (WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION.equals(action)) { + DeviceListFragment fragment = (DeviceListFragment) activity.getFragmentManager() + .findFragmentById(R.id.frag_list); + fragment.updateThisDevice((WifiP2pDevice) intent.getParcelableExtra( + WifiP2pManager.EXTRA_WIFI_P2P_DEVICE)); + + } + } +</pre> + +<p>Finally, add code to register the intent filter and broadcast receiver when +your main activity is active, and unregister them when the activity is paused. +The best place to do this is the {@link android.app.Activity#onResume()} and +{@link android.app.Activity#onPause()} methods. + +<pre> + /** register the BroadcastReceiver with the intent values to be matched */ + @Override + public void onResume() { + super.onResume(); + receiver = new WiFiDirectBroadcastReceiver(mManager, mChannel, this); + registerReceiver(receiver, intentFilter); + } + + @Override + public void onPause() { + super.onPause(); + unregisterReceiver(receiver); + } +</pre> + + +<h2 id="discover">Initiate Peer Discovery</h2> +<p>To start searching for nearby devices with Wi-Fi Direct, call {@link +android.net.wifi.p2p.WifiP2pManager#discoverPeers(WifiP2pManager.Channel, +WifiP2pManager.ActionListener) discoverPeers()}. This method takes the +following arguments:</p> +<ul> + <li>The {@link android.net.wifi.p2p.WifiP2pManager.Channel} you + received back when you initialized the peer-to-peer mManager</li> + <li>An implementation of {@link android.net.wifi.p2p.WifiP2pManager.ActionListener} with methods + the system invokes for successful and unsuccessful discovery.</li> +</ul> + +<pre> +mManager.discoverPeers(mChannel, new WifiP2pManager.ActionListener() { + + @Override + public void onSuccess() { + // Code for when the discovery initiation is successful goes here. + // No services have actually been discovered yet, so this method + // can often be left blank. Code for peer discovery goes in the + // onReceive method, detailed below. + } + + @Override + public void onFailure(int reasonCode) { + // Code for when the discovery initiation fails goes here. + // Alert the user that something went wrong. + } +}); +</pre> + +<p>Keep in mind that this only <em>initiates</em> peer discovery. The +{@link android.net.wifi.p2p.WifiP2pManager#discoverPeers(WifiP2pManager.Channel, +WifiP2pManager.ActionListener) discoverPeers()} method starts the discovery process and then +immediately returns. The system notifies you if the peer discovery process is +successfully initiated by calling methods in the provided action listener. +Also, discovery will remain active until a connection is initiated or a P2P group is +formed.</p> + +<h2 id="fetch">Fetch the List of Peers</h2> +<p>Now write the code that fetches and processes the list of peers. First +implement the {@link android.net.wifi.p2p.WifiP2pManager.PeerListListener} +interface, which provides information about the peers that Wi-Fi Direct has +detected. The following code snippet illustrates this.</p> + +<pre> + private List<WifiP2pDevice> peers = new ArrayList<WifiP2pDevice>(); + ... + + private PeerListListener peerListListener = new PeerListListener() { + @Override + public void onPeersAvailable(WifiP2pDeviceList peerList) { + + // Out with the old, in with the new. + peers.clear(); + peers.addAll(peerList.getDeviceList()); + + // If an AdapterView is backed by this data, notify it + // of the change. For instance, if you have a ListView of available + // peers, trigger an update. + ((WiFiPeerListAdapter) getListAdapter()).notifyDataSetChanged(); + if (peers.size() == 0) { + Log.d(WiFiDirectActivity.TAG, "No devices found"); + return; + } + } + } +</pre> + +<p>Now modify your broadcast receiver's {@link +android.content.BroadcastReceiver#onReceive(Context, Intent) onReceive()} +method to call {@link android.net.wifi.p2p.WifiP2pManager#requestPeers +requestPeers()} when an intent with the action {@link +android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_PEERS_CHANGED_ACTION} is received. You +need to pass this listener into the receiver somehow. One way is to send it +as an argument to the broadcast receiver's constructor. +</p> + +<pre> +public void onReceive(Context context, Intent intent) { + ... + else if (WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION.equals(action)) { + + // Request available peers from the wifi p2p manager. This is an + // asynchronous call and the calling activity is notified with a + // callback on PeerListListener.onPeersAvailable() + if (mManager != null) { + mManager.requestPeers(mChannel, peerListener); + } + Log.d(WiFiDirectActivity.TAG, "P2P peers changed"); + }... +} +</pre> + +<p>Now, an intent with the action {@link +android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_PEERS_CHANGED_ACTION} intent will +trigger a request for an updated peer list. </p> + +<h2 id="connect">Connect to a Peer</h2> +<p>In order to connect to a peer, create a new {@link +android.net.wifi.p2p.WifiP2pConfig} object, and copy data into it from the +{@link android.net.wifi.p2p.WifiP2pDevice} representing the device you want to +connect to. Then call the {@link +android.net.wifi.p2p.WifiP2pManager#connect(WifiP2pManager.Channel, +WifiP2pConfig, WifiP2pManager.ActionListener) connect()} +method.</p> + +<pre> + @Override + public void connect() { + // Picking the first device found on the network. + WifiP2pDevice device = peers.get(0); + + WifiP2pConfig config = new WifiP2pConfig(); + config.deviceAddress = device.deviceAddress; + config.wps.setup = WpsInfo.PBC; + + mManager.connect(mChannel, config, new ActionListener() { + + @Override + public void onSuccess() { + // WiFiDirectBroadcastReceiver will notify us. Ignore for now. + } + + @Override + public void onFailure(int reason) { + Toast.makeText(WiFiDirectActivity.this, "Connect failed. Retry.", + Toast.LENGTH_SHORT).show(); + } + }); + } +</pre> + +<p>The {@link android.net.wifi.p2p.WifiP2pManager.ActionListener} implemented in +this snippet only notifies you when the <em>initiation</em> succeeds or fails. +To listen for <em>changes</em> in connection state, implement the {@link +android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener} interface. Its {@link +android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener#onConnectionInfoAvailable(WifiP2pInfo) +onConnectionInfoAvailable()} +callback will notify you when the state of the connection changes. In cases +where multiple devices are going to be connected to a single device (like a game with +3 or more players, or a chat app), one device will be designated the "group +owner".</p> + +<pre> + @Override + public void onConnectionInfoAvailable(final WifiP2pInfo info) { + + // InetAddress from WifiP2pInfo struct. + InetAddress groupOwnerAddress = info.groupOwnerAddress.getHostAddress()); + + // After the group negotiation, we can determine the group owner. + if (info.groupFormed && info.isGroupOwner) { + // Do whatever tasks are specific to the group owner. + // One common case is creating a server thread and accepting + // incoming connections. + } else if (info.groupFormed) { + // The other device acts as the client. In this case, + // you'll want to create a client thread that connects to the group + // owner. + } + } +</pre> + +<p>Now go back to the {@link +android.content.BroadcastReceiver#onReceive(Context, Intent) onReceive()} method of the broadcast receiver, and modify the section +that listens for a {@link +android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_CONNECTION_CHANGED_ACTION} intent. +When this intent is received, call {@link +android.net.wifi.p2p.WifiP2pManager#requestConnectionInfo(WifiP2pManager.Channel, +WifiP2pManager.ConnectionInfoListener) requestConnectionInfo()}. This is an +asynchronous call, so results will be received by the connection info listener +you provide as a parameter. + +<pre> + ... + } else if (WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION.equals(action)) { + + if (mManager == null) { + return; + } + + NetworkInfo networkInfo = (NetworkInfo) intent + .getParcelableExtra(WifiP2pManager.EXTRA_NETWORK_INFO); + + if (networkInfo.isConnected()) { + + // We are connected with the other device, request connection + // info to find group owner IP + + mManager.requestConnectionInfo(mChannel, connectionListener); + } + ... +</pre> diff --git a/docs/html/training/custom-views/create-view.jd b/docs/html/training/custom-views/create-view.jd index b0bc8b4..674bcc9 100644 --- a/docs/html/training/custom-views/create-view.jd +++ b/docs/html/training/custom-views/create-view.jd @@ -61,7 +61,7 @@ well-designed class, though, a custom view should: existing view subclasses, such as {@link android.widget.Button}.</p> -<p>To allow the <a href=”{@docRoot}guide/developing/tools/adt.html”>Android Developer Tools +<p>To allow the <a href="{@docRoot}guide/developing/tools/adt.html">Android Developer Tools </a> to interact with your view, at a minimum you must provide a constructor that takes a {@link android.content.Context} and an {@link android.util.AttributeSet} object as parameters. This constructor allows the layout editor to create and edit an instance of your view.</p> @@ -105,7 +105,7 @@ enable this behavior in your custom view, you must: <pre> <resources>; - <declare-styleable name="PieChart"> + <declare-styleable name="PieChart"> <attr name="showText" format="boolean" /> <attr name="labelPosition" format="enum"> <enum name="left" value="0"/> @@ -276,6 +276,6 @@ public void setShowText(boolean showText) { </ul> <p>For more information on creating accessible views, see - <a href=”{@docRoot}guide/topics/ui/accessibility/apps.html#custom-views”> + <a href="{@docRoot}guide/topics/ui/accessibility/apps.html#custom-views"> Making Applications Accessible</a> in the Android Developers Guide. </p> diff --git a/docs/html/training/custom-views/optimizing-view.jd b/docs/html/training/custom-views/optimizing-view.jd index 1f489dd..7f2e762 100644 --- a/docs/html/training/custom-views/optimizing-view.jd +++ b/docs/html/training/custom-views/optimizing-view.jd @@ -19,7 +19,7 @@ previous.link=making-interactive.html <h2>You should also read</h2> <ul> - <li><a href=”{@docRoot}guide/topics/graphics/hardware-accel.html”> + <li><a href="{@docRoot}guide/topics/graphics/hardware-accel.html"> Hardware Acceleration </a> </li> diff --git a/docs/html/training/implementing-navigation/lateral.jd b/docs/html/training/implementing-navigation/lateral.jd index 76acf03..b59bab2 100644 --- a/docs/html/training/implementing-navigation/lateral.jd +++ b/docs/html/training/implementing-navigation/lateral.jd @@ -119,7 +119,7 @@ public void onCreate(Bundle savedInstanceState) { <h2 id="horizontal-paging">Implement Horizontal Paging (Swipe Views)</h2> -<p>Horizontal paging, or swipe views, allow users to <a href="{@docRoot}design/patterns/swipe-views">swipe</a> horizontally on the current screen to navigate to adjacent screens. This pattern can be implemented using the {@link android.support.v4.view.ViewPager} widget, currently available as part of the <a href="{@docRoot}tools/extras/support-library.html">Android Support Package</a>. For navigating between sibling screens representing a fixed number of sections, it's best to provide the {@link android.support.v4.view.ViewPager} with a {@link android.support.v4.app.FragmentPagerAdapter}. For horizontal paging across collections of objects, it's best to use a {@link android.support.v4.app.FragmentStatePagerAdapter}, which destroys fragments as the user navigates to other pages, minimizing memory usage.</p> +<p>Horizontal paging, or swipe views, allow users to <a href="{@docRoot}design/patterns/swipe-views.html">swipe</a> horizontally on the current screen to navigate to adjacent screens. This pattern can be implemented using the {@link android.support.v4.view.ViewPager} widget, currently available as part of the <a href="{@docRoot}tools/extras/support-library.html">Android Support Package</a>. For navigating between sibling screens representing a fixed number of sections, it's best to provide the {@link android.support.v4.view.ViewPager} with a {@link android.support.v4.app.FragmentPagerAdapter}. For horizontal paging across collections of objects, it's best to use a {@link android.support.v4.app.FragmentStatePagerAdapter}, which destroys fragments as the user navigates to other pages, minimizing memory usage.</p> <p>Below is an example of using a {@link android.support.v4.view.ViewPager} to swipe across a collection of objects.</p> diff --git a/docs/html/training/improving-layouts/reusing-layouts.jd b/docs/html/training/improving-layouts/reusing-layouts.jd index 095b0dd..fdd3333 100644 --- a/docs/html/training/improving-layouts/reusing-layouts.jd +++ b/docs/html/training/improving-layouts/reusing-layouts.jd @@ -25,12 +25,9 @@ next.link=loading-ondemand.html <!-- other docs (NOT javadocs) --> <h2>You should also read</h2> <ul> - <li><a href="{@docRoot}resources/articles/layout-tricks-reuse.html">Creating Reusable UI -Components</a></li> - <li><a href="{@docRoot}resources/articles/layout-tricks-merge.html">Merging Layouts</a></li> <li><a href="{@docRoot}guide/topics/resources/layout-resource.html#include-element">Layout -Resource</a></li> +Resources</a></li> </ul> </div> diff --git a/docs/html/training/improving-layouts/smooth-scrolling.jd b/docs/html/training/improving-layouts/smooth-scrolling.jd index 0afa929..2a1ffba 100644 --- a/docs/html/training/improving-layouts/smooth-scrolling.jd +++ b/docs/html/training/improving-layouts/smooth-scrolling.jd @@ -22,8 +22,8 @@ previous.link=loading-ondemand.html <!-- other docs (NOT javadocs) --> <h2>You should also read</h2> <ul> - <li><a href="{@docRoot}resources/articles/listview-backgrounds.html">ListView -Backgrounds: An Optimization</a></li> + <li><a href="http://android-developers.blogspot.com/2009/01/why-is-my-list-black-android.html">Why + is my list black? An Android optimization</a></li> </ul> </div> diff --git a/docs/html/training/notepad/index.jd b/docs/html/training/notepad/index.jd index 87a57d1..64ba144 100644 --- a/docs/html/training/notepad/index.jd +++ b/docs/html/training/notepad/index.jd @@ -1,6 +1,5 @@ page.title=Notepad Tutorial parent.title=Tutorials -parent.link=../../browser.html?tag=tutorial @jd:body diff --git a/docs/html/training/training_toc.cs b/docs/html/training/training_toc.cs index 37b69d4..b70ba3f 100644 --- a/docs/html/training/training_toc.cs +++ b/docs/html/training/training_toc.cs @@ -673,6 +673,27 @@ </li> + <li class="nav-section"> + <div class="nav-section-header"><a href="<?cs var:toroot ?>training/connect-devices-wirelessly/index.html"> + <span class="en">Connecting Devices Wirelessly</span> + </a></div> + <ul> + <li><a href="<?cs var:toroot ?>training/connect-devices-wirelessly/nsd.html"> + <span class="en">Using Network Service Discovery</span> + </a> + </li> + <li><a href="<?cs var:toroot ?>training/connect-devices-wirelessly/wifi-direct.html"> + <span class="en">Connecting with Wi-Fi Direct</span> + </a> + </li> + <li><a href="<?cs var:toroot ?>training/connect-devices-wirelessly/nsd-wifi-direct.html"> + <span class="en">Using Wi-Fi Direct for Service Discovery</span> + </a> + </li> + </ul> + </li> + + </ul> </li> </ul><!-- nav --> |