diff options
Diffstat (limited to 'docs/html')
38 files changed, 1016 insertions, 89 deletions
diff --git a/docs/html/about/versions/android-5.0.jd b/docs/html/about/versions/android-5.0.jd index f8d8ab6..a438420 100644 --- a/docs/html/about/versions/android-5.0.jd +++ b/docs/html/about/versions/android-5.0.jd @@ -23,6 +23,7 @@ sdk.platform.apiLevel=21 <li><a href="#BehaviorGetRecentTasks">If your app uses getRecentTasks()...</a></li> <li><a href="#64BitSupport">If you are using the Android Native Development Kit (NDK)...</a></li> <li><a href="#BindService">If your app binds to a Service...</a></li> +<li><a href="#BehaviorWebView">If your app uses a WebView...</a></li> </ol> </li> <li><a href="#UI">User Interface</a> @@ -234,8 +235,8 @@ the system can present notifications correctly in vibration.</p> <p>Setting the device to -{@link android.media.AudioManager#RINGER_MODE_SILENT RINGER_MODE_SILENT} now -causes the device to enter the new priority mode. The device leaves priority +{@link android.media.AudioManager#RINGER_MODE_SILENT RINGER_MODE_SILENT} causes +the device to enter the new priority mode. The device leaves priority mode if you set it to {@link android.media.AudioManager#RINGER_MODE_NORMAL RINGER_MODE_NORMAL} or {@link android.media.AudioManager#RINGER_MODE_NORMAL RINGER_MODE_VIBRATE}.</p> @@ -366,6 +367,31 @@ and throws an exception if given an implicit intent. To ensure your app is secure, use an explicit intent when starting or binding your {@link android.app.Service}, and do not declare intent filters for the service.</p> +<h3 id="BehaviorWebView">If your app uses WebView...</h3> + +<p>Android 5.0 changes the default behavior for your app.</p> +<ul> +<li><strong>If your app targets API level 21 or higher:</strong> + <ul> + <li>The system + blocks <a href="https://developer.mozilla.org/en-US/docs/Security/MixedContent" + class="external-link">mixed content</a> and third party cookies by default. To allow mixed + content and third party cookies, use the + {@link android.webkit.WebSettings#setMixedContentMode(int) setMixedContentMode()} +and {@link android.webkit.CookieManager#setAcceptThirdPartyCookies(android.webkit.WebView, boolean) setAcceptThirdPartyCookies()} +methods respectively.</li> + <li>The system now intelligently chooses portions of the HTML + document to draw. This new default behavior helps to reduce memory + footprint and increase performance. If you want to + render the whole document at once, disable this optimization by calling + {@link android.webkit.WebView#enableSlowWholeDocumentDraw()}.</li> + </ul> +</li> +<li><strong>If your app targets API levels lower than 21:</strong> The system + allows mixed content and third party cookies, and always renders the whole + document at once.</li> +</ul> + <h2 id="UI">User Interface</h2> <h3 id="MaterialDesign">Material design support</h3> @@ -470,7 +496,7 @@ request the user’s permission by launching a screen capture dialog using an method.</p> <p>For an example of how to use the new APIs, see the {@code MediaProjectionDemo} -class in the {@code ApiDemos} sample project.</p> +class in the sample project.</p> <h2 id="Notifications">Notifications</h2> diff --git a/docs/html/about/versions/lollipop.jd b/docs/html/about/versions/lollipop.jd index 085dc24..3ee0a86 100644 --- a/docs/html/about/versions/lollipop.jd +++ b/docs/html/about/versions/lollipop.jd @@ -206,15 +206,16 @@ video apps and games to display smooth synchronized content.</p> <p>Android 5.0 also adds support for <strong>multimedia tunneling</strong> to provide the best experience for ultra-high definition (4K) content and the ability to play compressed audio and video data together. </p> -<!-- + <div class="figure" style="width:320px; margin:1em 0 0 20px;padding-left:2em;"> <img style="float:right; margin:0 1em 1em 2em" src="{@docRoot}images/android-5.0/managed_apps_launcher@2x.png" srcset="{@docRoot}images/android-5.0/managed_apps_launcher@2x.png 2x" alt="" width="300" /> -<p class="img-caption">Android Work users have a unified view of their personal and work apps, which are badged for easy identification.</p> +<p class="img-caption">Users have a unified view of their personal and work apps, which are +badged for easy identification.</p> </div> ---> + <h2 id="Work">Android in the workplace</h2> diff --git a/docs/html/distribute/essentials/essentials_toc.cs b/docs/html/distribute/essentials/essentials_toc.cs index 4e53468..a1c9575 100644 --- a/docs/html/distribute/essentials/essentials_toc.cs +++ b/docs/html/distribute/essentials/essentials_toc.cs @@ -17,6 +17,12 @@ </div> </li> <li class="nav-section"> + <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/essentials/quality/wear.html"> + <span class="en">Wear App Quality</span> + </a> + </div> + </li> + <li class="nav-section"> <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/essentials/optimizing-your-app.html"> <span class="en">Optimize Your App</span> </a> diff --git a/docs/html/distribute/essentials/quality/tv.jd b/docs/html/distribute/essentials/quality/tv.jd index 8e17157..b13307e 100644 --- a/docs/html/distribute/essentials/quality/tv.jd +++ b/docs/html/distribute/essentials/quality/tv.jd @@ -234,7 +234,7 @@ page.image=/distribute/images/gp-tv-quality.png </td> <td> <p style="margin-bottom:.5em;"> - App does not depend on a remote controller having a menu button to access user interface + App does not depend on a remote controller having a Menu button to access user interface controls. (<a href="{@docRoot}training/tv/start/navigation.html#d-pad-navigation">Learn how</a>) </p> @@ -291,8 +291,8 @@ data-sortorder="-timestamp" data-cardsizes="9x3" data-maxresults="6"> </td> <td> <p style="margin-bottom:.5em;"> - App manifest sets an intent type of {@code ACTION_MAIN} with category - {@code CATEGORY_LEANBACK_LAUNCHER}. + App manifest sets an intent type of {@link android.content.Intent#ACTION_MAIN} with category + {@link android.content.Intent#CATEGORY_LEANBACK_LAUNCHER}. (<a href="{@docRoot}training/tv/start/start.html#tv-activity">Learn how</a>) </p> </td> @@ -321,8 +321,9 @@ data-sortorder="-timestamp" data-cardsizes="9x3" data-maxresults="6"> </td> <td> <p style="margin-bottom:.5em;"> - If the app requires a game controller, the app manifest sets the {@code uses-feature} setting - {@code android.hardware.gamepad} to {@code required="true"}. + If the app uses a game controller as it's primary input method, it declares the appropriate + requirement with the <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html" + >{@code <uses-feature>}</a> manifest tag. (<a href="{@docRoot}training/tv/games/index.html#gamepad">Learn how</a>) </p> </td> @@ -334,9 +335,9 @@ data-sortorder="-timestamp" data-cardsizes="9x3" data-maxresults="6"> </td> <td> <p style="margin-bottom:.5em;"> - If the app provides user instructions for use of game controllers, the instructions - do not include a controller with any branding. - (<a href="{@docRoot}training/tv/games/index.html#generic-controllers">Learn how</a>) + If the app provides visual instructions for using game controllers, the instructions should + be free of branding and show a compatible button layout. + (<a href="{@docRoot}training/tv/games/index.html#ControllerHelp">Learn how</a>) </p> </td> </tr> @@ -351,7 +352,7 @@ data-sortorder="-timestamp" data-cardsizes="9x3" data-maxresults="6"> </td> <td> <p style="margin-bottom:.5em;"> - App enables interaction with any advertising using D-pad controls. + App allows interaction with advertising using D-pad controls. (<a href="{@docRoot}training/tv/start/navigation.html#d-pad-navigation">Learn how</a>) </p> </td> @@ -363,7 +364,7 @@ data-sortorder="-timestamp" data-cardsizes="9x3" data-maxresults="6"> </td> <td> <p style="margin-bottom:.5em;"> - For advertising that uses full-screen, non-video ads, the app allows the user to + For advertising that uses fullscreen, non-video ads, the app allows the user to immediately dismiss the ad with D-pad controls. </p> </td> @@ -375,7 +376,7 @@ data-sortorder="-timestamp" data-cardsizes="9x3" data-maxresults="6"> </td> <td> <p style="margin-bottom:.5em;"> - For advertising that uses clickable, non-full screen, non-video ads, the app does not allow + For advertising that uses clickable, non-fullscreen, non-video ads, the app does not allow ads to link to a web URL. </p> </td> @@ -387,7 +388,7 @@ data-sortorder="-timestamp" data-cardsizes="9x3" data-maxresults="6"> </td> <td> <p style="margin-bottom:.5em;"> - For advertising that uses clickable, non-full screen, non-video ads, the app does not allow + For advertising that uses clickable, non-fullscreen, non-video ads, the app does not allow ads to link to another app that is not available on TV devices. </p> </td> diff --git a/docs/html/distribute/essentials/quality/wear.jd b/docs/html/distribute/essentials/quality/wear.jd new file mode 100644 index 0000000..667e945 --- /dev/null +++ b/docs/html/distribute/essentials/quality/wear.jd @@ -0,0 +1,387 @@ +page.title=Wear App Quality +page.tags="wear","wearables","quality","guidelines" +page.metaDescription=Wearables are small factor devices that are built for glanceability and require unique design and functionality. +page.image=/distribute/images/gp-wear-quality.png +@jd:body + +<div id="qv-wrapper"><div id="qv"> +<h2>Quality Criteria</h2> + <ol> + <li><a href="#ux">Design and Interaction</a></li> + <li><a href="#fn">Functionality</a></li> + <li><a href="#faq">Frequently Asked Questions</a></li> + </ol> + + <h2>You Should Also Read</h2> + <ol> + <li><a href="{@docRoot}distribute/essentials/quality/core.html"> + Core App Quality</a></li> + <li><a href="{@docRoot}distribute/essentials/optimizing-your-app.html"> + Optimize Your App</a></li> + <li><a href="{@docRoot}design/patterns/notifications.html"> + Notifications</a></li> + </ol> +</div> +</div> + +<img src="{@docRoot}distribute/images/gp-wear-quality.png" style="width:480px;"> + +<p> + Android Wear aims to provide users with just the right information at just the right time. Great + Android Wear experiences are launched automatically, glanceable, and require zero or low user + interaction. Designing apps for wearables is substantially different than designing for phones or + tablets. There are different strengths and weaknesses, different use cases, and different + ergonomics to take into consideration. +</p> + +<p> + The first step toward creating a great experience for users on Wear is to read the + <a href="{@docRoot}design/wear/index.html">Android Wear design guidelines</a>, which provides + instructions on how to build the best user experience for Wear apps. You should also review the + <a href="{@docRoot}training/building-wearables.html">Building Apps for Wearables</a> training, to + understand the basic implementation requirements for a Wear app. +</p> + +<p class="caution"> + <strong>Important:</strong> To ensure a great user experience, apps for wearables must meet + specific requirements for usability. Only apps that meet the following quality criteria will + qualify as an Android Wear app on Google Play. Qualifying as a Wear app will make it easier for + Android Wear users to discover your app on Google Play. +</p> + +<p class="note"> + <strong>Note:</strong> You will be able to submit your apps for Android Wear review when the + public release of Android 5.0 launches on November 3. Stay tuned for more information about how to + submit your apps for Android Wear review through the <a href="https://play.google.com/apps/publish/signup/">Google Play Developer Console</a>. +</p> + +<div class="headerLine"> + <h2 id="fn"> + Functionality + </h2> + + +</div> + +<p> + These criteria ensure that your app is configured correctly and provides the expected + functional behavior. +</p> + + +<table> +<tr> + <th style="width:2px;"> + Type + </th> + <th style="width:54px;"> + ID + </th> + <th> + Description + </th> +</tr> + +<tr> + <td rowspan="1" id="general"> + General + </td> + + <td id="WR-GL"> + WR-GL + </td> + <td> + <p style="margin-bottom:.5em;"> + Handheld app includes either notifications with wearable-specific functionality or a wearable + app that runs directly on the Wear device. + (<a href="{@docRoot}training/building-wearables.html">Learn how</a>) + </p> + </td> +</tr> + +<tr> + <td rowspan="1" id="packaging"> + Packaging + </td> + + <td id="WR-PK"> + WR-PK + </td> + <td> + <p style="margin-bottom:.5em;"> + Wearable apps that run directly on the device are packaged inside the primary handheld app. + (<a href="{@docRoot}training/wearables/apps/packaging.html">Learn how</a>) + </p> + </td> +</tr> + + +<tr> + <td rowspan="3" id="functional-notifications"> + Notifications + </td> + + <td id="WR-FW"> + WR-FW + </td> + <td> + <p style="margin-bottom:.5em;"> + Notifications with wearable-specific functionality use a {@code RemoteInput} or + {@code WearableExtender}. + (<a href="{@docRoot}training/wearables/notifications/index.html">Learn how</a>) + </p> + </td> +</tr> + +<tr> + <td id="WR-FR"> + WR-FR + </td> + <td> + <p style="margin-bottom:.5em;"> + Notifications for messaging apps allow users to reply via voice input or quick responses. + (<a href="{@docRoot}training/wearables/notifications/voice-input.html">Learn how</a>) + </p> + </td> +</tr> + +<tr> + <td id="WR-FG"> + WR-FG + </td> + <td> + <p style="margin-bottom:.5em;"> + Similar notifications are grouped together in a stack. + (<a href="{@docRoot}training/wearables/notifications/stacks.html">Learn how</a>) + </p> + </td> +</tr> + +<tr> + <td rowspan="1" id="gestures"> + Gestures + </td> + + <td id="WR-GP"> + WR-GP + </td> + <td> + <p style="margin-bottom:.5em;"> + Full-screen activities use long press for the sole purpose of prompting to quit. + <br/> + (<a href="{@docRoot}training/wearables/ui/exit.html">Learn how</a>) + </p> + </td> +</tr> + +</table> + + +<h3 class="rel-resources clearfloat">Related resources</h3> + +<div class="resource-widget resource-flow-layout col-13" data-query= +"collection:distribute/essentials/wearqualityguidelines/functionality" +data-sortorder="-timestamp" data-cardsizes="6x2" data-maxresults="6"> +</div> + +<div class="headerLine"> + <h2 id="ux"> + Visual Design and User Interaction + </h2> + + +</div> + +<p> + These criteria ensure that your app follows critical design and interaction patterns to provide a + consistent, intuitive, and enjoyable user experience on wearables. +</p> + +<table> + +<tr> + <th style="width:2px;"> + Type + </th> + <th style="width:54px;"> + ID + </th> + <th> + Description + </th> +</tr> + +<tr> + <td rowspan="2" id="layout"> + Layout + </td> + + <td id="WR-LL"> + WR-LL + </td> + <td> + <p style="margin-bottom:.5em;"> + App user interface is formatted appropriately for both square and round displays. + (<a href="{@docRoot}training/wearables/ui/layouts.html">Learn how</a>) + </p> + </td> +</tr> + +<tr> + <td id="WR-TC"> + WR-TC + </td> + <td> + <p style="margin-bottom:.5em;"> + App text is large and glanceable with a suggested minimum size of 16sp. + (<a href="{@docRoot}design/wear/style.html#Typography">Learn how</a>) + </p> + </td> +</tr> + +<tr> + <td rowspan="1" id="launcher"> + Launcher + </td> + + <td id="WR-LN"> + WR-LN + </td> + <td> + <p style="margin-bottom:.5em;"> + App launcher string is the app name, not a command phrase. + (<a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">Learn how</a>) + </p> + </td> +</tr> + +<tr> + <td rowspan="5" id="notifications"> + Notifications + </td> + + <td id="WR-NC"> + WR-NC + </td> + <td> + <p style="margin-bottom:.5em;"> + App displays confirmation animations when appropriate. + (<a href="{@docRoot}design/wear/patterns.html#Countdown">Learn how</a>) + </p> + </td> +</tr> + +<tr> + <td id="WR-NR"> + WR-NR + </td> + <td> + <p style="margin-bottom:.5em;"> + Notification cards have the app icon visible at the top right edge. The one exception is if the + notification card has single-action controls, for example a media playback card. + <br/> + (<a href="{@docRoot}design/wear/style.html#Assets">Learn how</a>) + </p> + </td> +</tr> + +<tr> + <td id="WR-WI"> + WR-WI + </td> + <td> + <p style="margin-bottom:.5em;"> + Notification actions have a white icon, action title, and transparent background. + <br/> + (<a href="{@docRoot}training/wearables/notifications/creating.html#ActionButtons">Learn how</a>) + </p> + </td> +</tr> + +<tr> + <td id="WR-PB"> + WR-PB + </td> + <td> + <p style="margin-bottom:.5em;"> + Notification photo backgrounds are used only to convey information, not to brand a card. + (<a href="{@docRoot}design/wear/style.html#Branding">Learn how</a>) + </p> + </td> +</tr> + +<tr> + <td id="WR-PR"> + WR-PR + </td> + <td> + <p style="margin-bottom:.5em;"> + Notification photo backgrounds have a resolution of at least 400x400. + (<a href="{@docRoot}training/wearables/notifications/creating.html#AddWearableFeatures">Learn how</a>) + </p> + </td> +</tr> + +<tr> + <td rowspan="1" id="googleplay"> + Google Play + </td> + + <td id="WR-GS"> + WR-GS + </td> + <td> + <p style="margin-bottom:.5em;"> + App includes at least one Wear screenshot in its Play Store Listing. + (<a href="https://support.google.com/googleplay/android-developer/answer/1078870?hl=en">Learn how</a>) + </p> + </td> +</tr> + +</table> + + +<h3 class="rel-resources clearfloat">Related resources</h3> + +<div class="resource-widget resource-flow-layout col-13" data-query= +"collection:distribute/essentials/wearqualityguidelines/visualdesign" +data-sortorder="-timestamp" data-cardsizes="6x2" data-maxresults="6"> +</div> + +<div class="headerLine"> + <h2 id="faq"> + Frequently Asked Questions + </h2> +</div> + +<p style="margin-top:30px;"> + <strong>After I submit my app for Android Wear review, how will I find out if my app does not meet + all the requirements for Wear?</strong> +</p> +<p> + If your app does not meet the usability requirements described on this page, the Play Store team + will contact you through the email address specified in the <a href= + "https://play.google.com/apps/publish/">Google Play Developer Console</a> account associated with + the app. +</p> +<p class="caution"> + <strong>Caution:</strong> Make sure your app meets the <a href="#fn">functionality + requirements</a>, otherwise your app will not be considered a Wear app and will not be reviewed + for Wear <a href="#ux">design and interaction</a>. +</p> +<p class="note"> + <strong>Note:</strong> You will be able to submit your apps for additional Android Wear review when + the public release of Android 5.0 launches on November 3. +</p> + + +<p style="margin-top:30px;"> + <strong>If my app does not meet the Wear requirements, will my new or updated app still appear on + Google Play for phones and tablets and still be installable on wearables?</strong> +</p> +<p> + Yes. The requirements described above only determine whether your app will be identified as an + Android Wear app on Google Play and easier for Android Wear users to discover. If your app is not + accepted as a Wear app, it will still be available to other device types, such as phones and + tablets, and it will still be installable on wearables. +</p> diff --git a/docs/html/distribute/images/gp-wear-quality.png b/docs/html/distribute/images/gp-wear-quality.png Binary files differnew file mode 100644 index 0000000..a51a32c --- /dev/null +++ b/docs/html/distribute/images/gp-wear-quality.png diff --git a/docs/html/images/android-5.0/managed_apps_launcher.png b/docs/html/images/android-5.0/managed_apps_launcher.png Binary files differindex 8184556..46e4c74 100644 --- a/docs/html/images/android-5.0/managed_apps_launcher.png +++ b/docs/html/images/android-5.0/managed_apps_launcher.png diff --git a/docs/html/images/android-5.0/managed_apps_launcher@2x.png b/docs/html/images/android-5.0/managed_apps_launcher@2x.png Binary files differindex 66b7be9..d7fdbce 100644 --- a/docs/html/images/android-5.0/managed_apps_launcher@2x.png +++ b/docs/html/images/android-5.0/managed_apps_launcher@2x.png diff --git a/docs/html/images/games/game-controller-buttons.png b/docs/html/images/games/game-controller-buttons.png Binary files differnew file mode 100644 index 0000000..b3e458a --- /dev/null +++ b/docs/html/images/games/game-controller-buttons.png diff --git a/docs/html/images/games/game-controller-buttons_2x.png b/docs/html/images/games/game-controller-buttons_2x.png Binary files differnew file mode 100644 index 0000000..7a0ad0b --- /dev/null +++ b/docs/html/images/games/game-controller-buttons_2x.png diff --git a/docs/html/jd_collections.js b/docs/html/jd_collections.js index c49f8cc..08c0090 100644 --- a/docs/html/jd_collections.js +++ b/docs/html/jd_collections.js @@ -67,9 +67,9 @@ var RESOURCE_COLLECTIONS = { "distribute/essentials/quality/core.html", "distribute/essentials/quality/tablets.html", "distribute/essentials/quality/tv.html", + "distribute/essentials/quality/wear.html", "https://developers.google.com/edu/guidelines", - "distribute/essentials/optimizing-your-app.html", - "distribute/essentials/best-practices/games.html" + "distribute/essentials/optimizing-your-app.html" ] }, "distribute/users": { @@ -332,6 +332,22 @@ var RESOURCE_COLLECTIONS = { "training/tv/games/index.html" ] }, + "distribute/essentials/wearqualityguidelines/visualdesign": { + "title": "", + "resources": [ + "design/wear/index.html", + "training/building-wearables.html", + "training/wearables/ui/index.html" + ] + }, + "distribute/essentials/wearqualityguidelines/functionality": { + "title": "", + "resources": [ + "training/wearables/notifications/index.html", + "training/wearables/apps/index.html", + "training/wearables/notifications/voice-input.html" + ] + }, "distribute/essentials/core/performance": { "title": "", "resources": [ diff --git a/docs/html/samples/new/index.jd b/docs/html/samples/new/index.jd index 523b922..330caa3 100644 --- a/docs/html/samples/new/index.jd +++ b/docs/html/samples/new/index.jd @@ -348,3 +348,18 @@ AppRestrictionEnforcer sample to toggle the restriction. </p> <p><a href="http://github.com/googlesamples/android-AppRestrictionSchema">Get it on GitHub</a></p> + +<h3 id="SpeedTracker">Speed Tracker (Wear)</h3> + +<p> +This sample uses the FusedLocation APIs of Google Play Services on Android Wear +devices that have a hardware GPS built in. In those cases, this sample provides +a simple screen that shows the current speed of the wearable device. User can +set a speed limit and if the speed approaches that limit, it changes the color +to yellow and if it exceeds the limit, it turns red. User can also enable +recording of coordinates and when it pairs back with the phone, this data +is synced with the phone component of the app and user can see a track +made of those coordinates on a map on the phone. +</p> + +<p><a href="http://github.com/googlesamples/android-SpeedTracker">Get it on GitHub</a></p> diff --git a/docs/html/samples/wearable.jd b/docs/html/samples/wearable.jd new file mode 100644 index 0000000..3114374 --- /dev/null +++ b/docs/html/samples/wearable.jd @@ -0,0 +1,11 @@ +page.title=Wearable +@jd:body + + +<div id="samples" class="wearable"> +</div> + + +<script> + $(document).ready(showSamples); +</script> diff --git a/docs/html/sdk/installing/adding-packages.jd b/docs/html/sdk/installing/adding-packages.jd index e6c0118..22d055c 100644 --- a/docs/html/sdk/installing/adding-packages.jd +++ b/docs/html/sdk/installing/adding-packages.jd @@ -1,5 +1,8 @@ page.title=Adding SDK Packages +page.tags=studio, sdk tools, eclipse adt, sdk manager, google play services, support library +helpoutsWidget=true + @jd:body <style> diff --git a/docs/html/sdk/installing/index.jd b/docs/html/sdk/installing/index.jd index ec0e2f8..6a99952 100644 --- a/docs/html/sdk/installing/index.jd +++ b/docs/html/sdk/installing/index.jd @@ -1,5 +1,8 @@ page.title=Installing the Android SDK +page.tags=studio, sdk tools, eclipse adt +helpoutsWidget=true + @jd:body <style> diff --git a/docs/html/support.jd b/docs/html/support.jd index 4271eee..bbed7df 100644 --- a/docs/html/support.jd +++ b/docs/html/support.jd @@ -3,6 +3,7 @@ page.type=about fullpage=1 page.metaDescription=Resources available to help you report and resolve issues while you are developing apps for Android. page.image=/images/android-support-card.png + @jd:body <div class="wrap" style="width:940px;"> @@ -28,13 +29,20 @@ page.image=/images/android-support-card.png <a href="http://webchat.freenode.net/?channels=android">#android</a>, <a href="http://webchat.freenode.net/?channels=android-dev">#android-dev</a> <span style="color:#888">(IRC via irc.freenode.net)</span><br /> </p> +<p><b> +<a target="_blank" +href="https://helpouts.google.com/partner/ask?vertical=programming&tags=android&origin=http:%2F%2Fdeveloper.android.com%2Fsupport.html">Ask a question in Google Helpouts</a> +</b></p> + <h5>Send Feedback</h5> <p> <a href="http://code.google.com/p/android/issues/entry?template=Developer%20Documentation">Report documentation bug</a><br /> <a href="https://code.google.com/p/android/issues/entry?template=User%20bug%20report">Report device bug</a><br /> <a href="https://code.google.com/p/android/issues/entry?template=Developer%20bug%20report">Report platform bug</a><br /> - +</p> + + </div> diff --git a/docs/html/tools/revisions/build-tools.jd b/docs/html/tools/revisions/build-tools.jd index fe78ce9..6f07755 100644 --- a/docs/html/tools/revisions/build-tools.jd +++ b/docs/html/tools/revisions/build-tools.jd @@ -77,6 +77,28 @@ listing in the Android SDK Manager.</p> <div class="toggle-content opened"> <p><a href="#" onclick="return toggleContent(this)"> <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" + alt=""/>Build Tools, Revision 21.0.2</a> <em>(October 2014)</em> + </p> + <div class="toggle-content-toggleme"> + <p>Complete updates for Eclipse ADT to solve instability issues on Windows platforms.</p> + </div> +</div> + + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" + alt=""/>Build Tools, Revision 21.0.1</a> <em>(October 2014)</em> + </p> + <div class="toggle-content-toggleme"> + <p>Initial updates for Eclipse ADT on Windows. Please use Revision 21.0.2.</p> + </div> +</div> + + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""/>Build Tools, Revision 21.0.0</a> <em>(October 2014)</em> </p> <div class="toggle-content-toggleme"> @@ -96,6 +118,7 @@ listing in the Android SDK Manager.</p> </div> </div> + <div class="toggle-content closed"> <p><a href="#" onclick="return toggleContent(this)"> <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" diff --git a/docs/html/tools/revisions/platforms.jd b/docs/html/tools/revisions/platforms.jd index 3fa1b9b..85b9c5e 100644 --- a/docs/html/tools/revisions/platforms.jd +++ b/docs/html/tools/revisions/platforms.jd @@ -80,6 +80,23 @@ class="toggle-content-img" alt="" />Revision 1</a> <em>(October 2014)</em> <h2 id="4.4">Android 4.4W</h2> +<div class="toggle-content open"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-open.png" +class="toggle-content-img" alt="" />Revision 2</a> <em>(October 2014)</em> + </p> + + <div class="toggle-content-toggleme"> + + <p>Added location APIs support for Wear.</p> + + <p>Dependencies:</p> + <ul> + <li>Android SDK Platform-tools r20 or higher is required.</li> + <li>Android SDK Tools 23.0 or higher is required.</li> + </ul> + </div> + <div class="toggle-content closed"> <p><a href="#" onclick="return toggleContent(this)"> <img src="{@docRoot}assets/images/triangle-closed.png" diff --git a/docs/html/tools/support-library/features.jd b/docs/html/tools/support-library/features.jd index 8311097..44c5045 100644 --- a/docs/html/tools/support-library/features.jd +++ b/docs/html/tools/support-library/features.jd @@ -139,10 +139,10 @@ page.title=Support Library Features <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> -com.android.support:support-v4:18.0.+ +com.android.support:support-v4:21.0.+ </pre> -<p>This dependency notation specifies the release version 18.0.0 or higher.</p> +<p>This dependency notation specifies the release version 21.0.0 or higher.</p> <h2 id="v7">v7 Support Libraries</h2> @@ -237,10 +237,10 @@ com.android.support:cardview-v7:21.0.+ <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> -com.android.support:gridlayout-v7:18.0.+ +com.android.support:gridlayout-v7:21.0.+ </pre> -<p>This dependency notation specifies the release version 18.0.0 or higher.</p> +<p>This dependency notation specifies the release version 21.0.0 or higher.</p> <h3 id="v7-mediarouter">v7 mediarouter library</h3> @@ -271,10 +271,10 @@ both the <code>android-support-v7-mediarouter.jar</code> and <p>If you are using Android Studio, all you need to do is specify the Gradle build script dependency identifier <code>com.android.support:support-v7-mediarouter:<revision></code>, -where "18.0.0" is the minimum revision at which the library is available. For example:</p> +where "<revision>" is the minimum revision at which the library is available. For example:</p> <pre> -com.android.support:mediarouter-v7:18.0.+ +com.android.support:mediarouter-v7:21.0.+ </pre> <p class="caution">The v7 mediarouter library APIs introduced in Support Library diff --git a/docs/html/training/articles/wear-location-detection.jd b/docs/html/training/articles/wear-location-detection.jd new file mode 100644 index 0000000..b0d9755 --- /dev/null +++ b/docs/html/training/articles/wear-location-detection.jd @@ -0,0 +1,375 @@ +page.title=Detecting Location on Android Wear +page.tags="gps" + +page.article=true +@jd:body + +<div id="tb-wrapper"> +<div id="tb"> +<h2>In this document</h2> +<ol class="nolist"> + <li><a href="#Connect">Connect to Google Play Services</a></li> + <li><a href="#Request">Request Location Updates</a></li> + <li><a href="#DetectGPS">Detect On-Board GPS</a></li> + <li><a href="#Disconnection">Handle Disconnection Events</a></li> + <li><a href="#Notify">Handle Location Not Found</a></li> + <li><a href="#Synchronize">Synchronize Data</a></li> +</ol> +<!-- Required platform, tools, add-ons, devices, knowledge, etc. --> +<h2>Dependencies and prerequisites</h2> +<ul> + <li>Android 4.3 (API Level 18) or higher on the handset device</li> + <li><a href="{@docRoot}google/play-services/index.html">Google Play services</a> 6.1 or higher</li> + <li>An Android Wear device</li> +</ul> +<h2>See also</h2> +<ul> + <li><a href="{@docRoot}training/location/index.html">Making Your App Location-Aware + </a></li> +</ul> +</div></div> + +<p>Location awareness on wearable devices enables you to create apps that give users a better +understanding of their geographic position, movement and what's around them. With the small form +factor and glanceable nature of a wearable device, you can build low-friction apps that record and +respond to location data.</p> + +<p>Some wearable devices include a GPS sensor that can retrieve location data without another +tethered device. However, when you request location data in a wearable app, you don't have to worry +about where the location data originates; the system retrieves the location updates using the most +power-efficient method. Your app should be able to handle loss of location data, in case the wear +device loses connection with its paired device and does not have a built-in GPS sensor.</p> + +<p>This document shows you how to check for on-device location sensors, receive location data, and +monitor tethered data connections.</p> + +<p class="note"><b>Note:</b> The article assumes that you know how to use the Google Play services +API to retrieve location data. For more information, see <a href="{@docRoot}training/ +location/index.html">Making Your App Location-Aware</a>.</p> + +<h2 id="Connect">Connect to Google Play Services</h2> + +<p>Location data on wearable devices is obtained though the Google Play services location APIs. You +use the <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html"> +<code>FusedLocationProviderApi</code></a> and its accompanying classes to obtain this data. +To access location services, create an instance of +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html"> +<code>GoogleApiClient</code></a>, which is +the main entry point for any of the Google Play services APIs. +</p> + +<p class="caution"><b>Caution:</b> Do not use the existing <a href="{@docRoot}reference/android/location/package-summary.html">Location</a> +APIs in the Android framework. The best practice for retrieving location updates is through the +Google Play services API as outlined in this article.</p> + +<p>To connect to Google Play services, configure your app to create an instance of +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html"> +<code>GoogleApiClient</code></a>:</p> + +<ol> + <li>Create an activity that specifies an implementation for the interfaces <a +href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.ConnectionCallbacks.html" +>{@code ConnectionCallbacks}</a>, <a href="{@docRoot}reference/com/google/android/gms/common/api/ +GoogleApiClient.OnConnectionFailedListener.html">{@code OnConnectionFailedListener}</a>, and <a +href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html">{@code +LocationListener}</a>.</li> + <li>In your activity's {@link android.app.Activity#onCreate onCreate()} method, create an instance +of <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html"><code> +GoogleApiClient</code></a> and add the Location service. + </li> + <li>To gracefully manage the lifecycle of the connection, call <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html#connect()"> + {@code connect()}</a> in the {@link android.app.Activity#onResume onResume()} method and + <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html#disconnect()"> + {@code disconnect()}</a> in the {@link android.app.Activity#onPause onPause()} method. + </li> +</ol> + +<p>The following code example shows an implementation of an activity that implements the +<a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html"> +{@code LocationListener}</a> interface:</p> + +<pre> +public class WearableMainActivity extends Activity implements + GoogleApiClient.ConnectionCallbacks, + GoogleApiClient.OnConnectionFailedListener, + LocationListener { + + private GoogleApiClient mGoogleApiClient; + ... + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + ... + mGoogleApiClient = new GoogleApiClient.Builder(this) + .addApi(LocationServices.API) + .addApi(Wearable.API) // used for data layer API + .addConnectionCallbacks(this) + .addOnConnectionFailedListener(this) + .build(); + } + + @Override + protected void onResume() { + super.onResume(); + mGoogleApiClient.connect(); + ... + } + + @Override + protected void onPause() { + super.onPause(); + ... + mGoogleApiClient.disconnect(); + } +} +</pre> + +<p>For more information on connecting to Google Play services, see <a href="{@docRoot}google/auth +/api-client.html">Accessing Google APIs</a>.</p> + +<h2 id="Request">Request Location Updates</h2> + +<p>After your app has connected to the Google Play services API, it is ready to start receiving +location updates. When the system invokes the +<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.ConnectionCallbacks.html#onConnected(android.os.Bundle)"> +<code>onConnected()</code></a> callback for your client, you build the location data request as +follows:</p> + +<ol> + <li>Create a <a +href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html" +>{@code LocationRequest}</a> object and set any options using methods like <a +href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)" +>{@code setPriority()}</a>. + </li> + <li>Request location updates using <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#requestLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.LocationRequest, com.google.android.gms.location.LocationListener)"> + <code>requestLocationUpdates()</code></a>. + </li> + <li>Remove location updates using <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#removeLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.LocationListener)"> + <code>removeLocationUpdates()</code></a> in the {@link android.app.Activity#onPause + onPause()} method. + </li> +</ol> + +<p>The following example shows how to retrieve and remove location updates:</p> + +<pre> +@Override +public void onConnected(Bundle bundle) { + LocationRequest locationRequest = LocationRequest.create() + .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) + .setInterval(UPDATE_INTERVAL_MS) + .setFastestInterval(FASTEST_INTERVAL_MS); + + LocationServices.FusedLocationApi + .requestLocationUpdates(mGoogleApiClient, locationRequest, this) + .setResultCallback(new ResultCallback<Status>() { + + @Override + public void onResult(Status status) { + if (status.getStatus().isSuccess()) { + if (Log.isLoggable(TAG, Log.DEBUG)) { + Log.d(TAG, "Successfully requested location updates"); + } + } else { + Log.e(TAG, + "Failed in requesting location updates, " + + "status code: " + + status.getStatusCode() + + ", message: " + + status.getStatusMessage()); + } + } + }); +} + +@Override +protected void onPause() { + super.onPause(); + if (mGoogleApiClient.isConnected()) { + LocationServices.FusedLocationApi + .removeLocationUpdates(mGoogleApiClient, this); + } + mGoogleApiClient.disconnect(); +} + +@Override +public void onConnectionSuspended(int i) { + if (Log.isLoggable(TAG, Log.DEBUG)) { + Log.d(TAG, "connection to location client suspended"); + } +} + +</pre> + +<p>Now that you have enabled location updates, the system calls the {@link android.location.LocationListener#onLocationChanged +onLocationChanged()} method with the updated location at the interval specified in <a +href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)"> +{@code setInterval()}</a> +</p> + +<h2 id="DetectGPS">Detect On-Board GPS</h2> + +<p>Not all wearables have a GPS sensor. If your user goes out for a run and leaves their phone at +home, your wearable app cannot receive location data through a tethered connection. If the +wearable device does not have a sensor, you should detect this situation and warn the user that +location functionality is not available. + +<p>To determine whether your Android Wear device has a built-in GPS sensor, use the +{@link android.content.pm.PackageManager#hasSystemFeature hasSystemFeature()} +method. The following code detects whether the device has built-in GPS when you start an activity: +</p> + +<pre> + +protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.main_activity); + if (!hasGps()) { + Log.d(TAG, "This hardware doesn't have GPS."); + // Fall back to functionality that does not use location or + // warn the user that location function is not available. + } + + ... +} + +private boolean hasGps() { + return getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS); +} +</pre> + +<h2 id="Disconnection">Handle Disconnection Events</h2> + +<p>Wearable devices relying on a tethered connection for location data may lose their connections +abruptly. If your wearable app expects a constant stream of data, you must handle the +disconnection based upon where that data is interrupted or unavailable. On a wearable device with no +onboard GPS sensor, loss of location data occurs when the device loses its tethered data connection. +</p> + +<p>In cases where your app depends on a tethered data connection for location data and the wear +device does not have a GPS sensor, you should detect the loss of that connection, warn the user, and +gracefully degrade the functionality of your app.</p> + +<p>To detect the loss of a tethered data connection:</p> + +<ol> + <li>Extend a <a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html"> + <code>WearableListenerService</code></a> that lets you listen for important data layer events. + </li> + <li>Declare an intent filter in your Android manifest to notify the system about your + <a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html"><code> + WearableListenerService</code></a>. + This filter allows the system to bind your service as needed. +<pre> +<service android:name=".NodeListenerService"> + <intent-filter> + <action android:name="com.google.android.gms.wearable.BIND_LISTENER" /> + </intent-filter> +</service> +</pre> + </li> + <li>Implement the <a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html#onPeerDisconnected(com.google.android.gms.wearable.Node)"> + <code>onPeerDisconnected()</code></a> method and handle cases of whether or not the device has + built-in + GPS. +<pre> +public class NodeListenerService extends WearableListenerService { + + private static final String TAG = "NodeListenerService"; + + @Override + public void onPeerDisconnected(Node peer) { + Log.d(TAG, "You have been disconnected."); + if(!hasGPS()) { + // Notify user to bring tethered handset + // Fall back to functionality that does not use location + } + } + ... +} +</pre> + </li> +</ol> + +For more information, read the <a href="{@docRoot}training/wearables/data-layer/events.html#Listen"> +Listen for Data Layer Events</a> guide. + +<h2 id="Notify">Handle Location Not Found</h2> + +<p>When the GPS signal is lost, you can still retrieve the last known location using +<a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#getLastLocation(com.google.android.gms.common.api.GoogleApiClient)"> +<code>getLastLocation()</code></a>. This method can be helpful in situations where you are unable to +get a GPS fix, or when your wearable doesn't have built-in GPS and loses its connection with the +phone.</p> + +<p>The following code uses <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#getLastLocation(com.google.android.gms.common.api.GoogleApiClient)"> +<code>getLastLocation()</code></a> to retrieve the last known location if available: +</p> + +<pre> +Location location = LocationServices.FusedLocationApi + .getLastLocation(mGoogleApiClient); +</pre> + +<h2 id="Synchronize">Synchronize Data</h2> + +<p>If your wearable app records data using the built-in GPS, you may want to synchronize +the location data with the handset. With the {@link android.location.LocationListener}, you +implement the {@link android.location.LocationListener#onLocationChanged onLocationChanged()} +method to detect and record the location as it changes. + +<p>The following code for wearable apps detects when the location changes and uses the data layer +API to store the data for later retrieval by your phone app:</p> + +<pre> +@Override +public void onLocationChanged(Location location) { + ... + addLocationEntry(location.getLatitude(), location.getLongitude()); + +} + +private void addLocationEntry(double latitude, double longitude) { + if (!mSaveGpsLocation || !mGoogleApiClient.isConnected()) { + return; + } + + mCalendar.setTimeInMillis(System.currentTimeMillis()); + + // Set the path of the data map + String path = Constants.PATH + "/" + mCalendar.getTimeInMillis(); + PutDataMapRequest putDataMapRequest = PutDataMapRequest.create(path); + + // Set the location values in the data map + putDataMapRequest.getDataMap() + .putDouble(Constants.KEY_LATITUDE, latitude); + putDataMapRequest.getDataMap() + .putDouble(Constants.KEY_LONGITUDE, longitude); + putDataMapRequest.getDataMap() + .putLong(Constants.KEY_TIME, mCalendar.getTimeInMillis()); + + // Prepare the data map for the request + PutDataRequest request = putDataMapRequest.asPutDataRequest(); + + // Request the system to create the data item + Wearable.DataApi.putDataItem(mGoogleApiClient, request) + .setResultCallback(new ResultCallback<DataApi.DataItemResult>() { + @Override + public void onResult(DataApi.DataItemResult dataItemResult) { + if (!dataItemResult.getStatus().isSuccess()) { + Log.e(TAG, "Failed to set the data, " + + "status: " + dataItemResult.getStatus() + .getStatusCode()); + } + } + }); +} +</pre> + +<p>For more information on how to use the Data Layer API, see the <a href="{@docRoot}training/ +wearables/data-layer/index.html">Sending and Syncing Data</a> +guide.</p> diff --git a/docs/html/training/basics/firstapp/building-ui.jd b/docs/html/training/basics/firstapp/building-ui.jd index 179b3ac..c082642 100644 --- a/docs/html/training/basics/firstapp/building-ui.jd +++ b/docs/html/training/basics/firstapp/building-ui.jd @@ -1,12 +1,8 @@ page.title=Building a Simple User Interface -parent.title=Building Your First App -parent.link=index.html - trainingnavtop=true -previous.title=Running Your App -previous.link=running-app.html -next.title=Starting Another Activity -next.link=starting-activity.html + +page.tags=ui, views, layouts, widgets, string resources +helpoutsWidget=true @jd:body diff --git a/docs/html/training/basics/firstapp/creating-project.jd b/docs/html/training/basics/firstapp/creating-project.jd index c4cb362..418eb68 100644 --- a/docs/html/training/basics/firstapp/creating-project.jd +++ b/docs/html/training/basics/firstapp/creating-project.jd @@ -1,6 +1,7 @@ page.title=Creating an Android Project -parent.title=Building Your First App -parent.link=index.html + +page.tags=eclipse adt, sdk tools, project setup +helpoutsWidget=true trainingnavtop=true next.title=Running Your App diff --git a/docs/html/training/basics/firstapp/index.jd b/docs/html/training/basics/firstapp/index.jd index 1b49096..ac8e64a 100644 --- a/docs/html/training/basics/firstapp/index.jd +++ b/docs/html/training/basics/firstapp/index.jd @@ -3,8 +3,9 @@ page.metaDescription=If you're new to Android app development, this where you sh trainingnavtop=true startpage=true -next.title=Creating an Android Project -next.link=creating-project.html + +page.tags=sdk tools +helpoutsWidget=true @jd:body @@ -47,6 +48,3 @@ not apply to earlier versions.</p> <p>This class uses a tutorial format that incrementally builds a small Android app that teaches you some fundamental concepts about Android development, so it's important that you follow each step.</p> - -<p><strong><a href="creating-project.html">Start the first lesson ›</a></strong></p> - diff --git a/docs/html/training/basics/firstapp/running-app.jd b/docs/html/training/basics/firstapp/running-app.jd index 23cedba..96b7172 100644 --- a/docs/html/training/basics/firstapp/running-app.jd +++ b/docs/html/training/basics/firstapp/running-app.jd @@ -3,10 +3,9 @@ parent.title=Building Your First App parent.link=index.html trainingnavtop=true -previous.title=Creating a Project -previous.link=creating-project.html -next.title=Building a Simple User Interface -next.link=building-ui.html + +page.tags=emulator +helpoutsWidget=true @jd:body diff --git a/docs/html/training/basics/firstapp/starting-activity.jd b/docs/html/training/basics/firstapp/starting-activity.jd index 27d2c10..f9dcba4 100644 --- a/docs/html/training/basics/firstapp/starting-activity.jd +++ b/docs/html/training/basics/firstapp/starting-activity.jd @@ -3,8 +3,9 @@ parent.title=Building Your First App parent.link=index.html trainingnavtop=true -previous.title=Building a Simpler User Interface -previous.link=building-ui.html + +page.tags=input events, intents, activity lifecycle +helpoutsWidget=true @jd:body diff --git a/docs/html/training/building-wearables.jd b/docs/html/training/building-wearables.jd index 0745c93..d751a81 100644 --- a/docs/html/training/building-wearables.jd +++ b/docs/html/training/building-wearables.jd @@ -1,6 +1,6 @@ page.title=Building Apps for Wearables page.trainingcourse=true -page.image=wear/images/notifications.png +page.image=wear/images/02_create.png page.metaDescription=Learn how to build notifications, send and sync data, and use voice actions. @jd:body diff --git a/docs/html/training/material/compatibility.jd b/docs/html/training/material/compatibility.jd index 5e03450..49ef7f7 100644 --- a/docs/html/training/material/compatibility.jd +++ b/docs/html/training/material/compatibility.jd @@ -131,9 +131,9 @@ href="{@docRoot}/sdk/installing/studio-build.html#dependencies">Gradle dependenc <pre> dependencies { - compile 'com.android.support:appcompat-v7:+' - compile 'com.android.support:cardview-v7:+' - compile 'com.android.support:recyclerview-v7:+' + compile 'com.android.support:appcompat-v7:21.0.+' + compile 'com.android.support:cardview-v7:21.0.+' + compile 'com.android.support:recyclerview-v7:21.0.+' } </pre> diff --git a/docs/html/training/material/drawables.jd b/docs/html/training/material/drawables.jd index 8d7f453..fd21e3d 100644 --- a/docs/html/training/material/drawables.jd +++ b/docs/html/training/material/drawables.jd @@ -73,7 +73,7 @@ app's module:</p> <pre> dependencies { ... - compile 'com.android.support:palette-v7:+' + compile 'com.android.support:palette-v7:21.0.+' } </pre> diff --git a/docs/html/training/material/lists-cards.jd b/docs/html/training/material/lists-cards.jd index eb45f0d..e7bdfe0 100644 --- a/docs/html/training/material/lists-cards.jd +++ b/docs/html/training/material/lists-cards.jd @@ -260,7 +260,7 @@ app's module:</p> <pre> dependencies { ... - compile 'com.android.support:cardview-v7:+' - compile 'com.android.support:recyclerview-v7:+' + compile 'com.android.support:cardview-v7:21.0.+' + compile 'com.android.support:recyclerview-v7:21.0.+' } </pre> diff --git a/docs/html/training/training_toc.cs b/docs/html/training/training_toc.cs index 0fee771..9f06666 100644 --- a/docs/html/training/training_toc.cs +++ b/docs/html/training/training_toc.cs @@ -834,6 +834,12 @@ include the action bar on devices running Android 2.1 or higher." </li> </ul> </li> + <li> + <a href="<?cs var:toroot ?>training/articles/wear-location-detection.html" + description= + "How to detect location data on Android Wear devices." + >Detecting Location</a> + </li> </ul> </li> <!-- End Building for wearables --> diff --git a/docs/html/training/tv/games/index.jd b/docs/html/training/tv/games/index.jd index 29b055b..2f510a9 100644 --- a/docs/html/training/tv/games/index.jd +++ b/docs/html/training/tv/games/index.jd @@ -31,7 +31,7 @@ page.article=true </p> -<h3 id="shared-display">Shared display</h3> +<h3 id="shared-display">Consider the shared display</h3> <p> A living-room TV poses design challenges for multiplayer games, in that all players can see @@ -57,7 +57,7 @@ page.article=true </ul> -<h3 id="landscape-display">Landscape display</h3> +<h3 id="landscape-display">Support landscape display</h3> <p> A TV is always sideways: You can’t turn it, and there is no portrait orientation. Always design @@ -69,19 +69,19 @@ page.article=true <p> TVs don't have touch interfaces, so it's even more important to get your controls right and make - sure that players find them intuitive and fun to use. The separation of controller from device - also introduces some other issues to pay attention to, like keeping track of multiple players' + sure players find them intuitive and fun to use. Handling controllers + also introduces some other issues to pay attention to, like keeping track of multiple controllers, and handling disconnects gracefully. </p> -<h3 id="d-pad">D-pad</h3> +<h3 id="d-pad">Support D-pad controls</h3> <p> Plan your control scheme around a directional pad (D-pad) control, since this control set is the default for Android TV devices. The player needs to be able to use a D-Pad in all aspects of the - game–not just controlling core gameplay, but also navigating menus and ads. For this reason, you - should also ensure that your Android TV game does not refer to a touch interface: For example, an - Android TV game should not tell a player to <strong>Tap here to skip</strong>. + game—not just controlling core gameplay, but also navigating menus and ads. For this reason, you + should also ensure that your Android TV game does not refer to a touch interface. For example, an + Android TV game should not tell a player to "<em>Tap</em> here to continue." </p> <p> @@ -91,35 +91,35 @@ page.article=true <ul> <li> - <strong>Communicate Controller Requirements up Front</strong> - Use your Play Store description + <strong>Communicate Controller Requirements up Front</strong>. Use your Google Play description to communicate to the player any expectations about controllers. If a game is better suited to a gamepad with a joystick than one with only a D-pad, make this fact clear. A player who uses - an ill-suited controller for a game is likely to have a subpar experience–and penalize your + an ill-suited controller for a game is likely to have a subpar experience and penalize your game in the ratings. </li> <li> - <strong>Use Consistent Button Mapping</strong> - Intuitive and flexible button mapping is key - to a good user experience. For example, you can adhere to accepted custom by using the A button - to <code>Accept</code>, and the B button to <code>Cancel</code>. You can also offer flexibility - in the form of remappability. For more information on button mapping, see <a href= + <strong>Use Consistent Button Mapping</strong>. Intuitive and flexible button mapping is key + to a good user experience. For example, you should adhere to accepted customs by using the A button + to <em>Accept</em>, and the B button to <em>Cancel</em>. You can also offer flexibility + in the form of remappability. For more information about button mapping, see <a href= "http://developer.android.com/training/game-controllers/controller-input.html">Handling Controller Actions</a>. </li> <li> - <strong>Detect Controller Capabilities and Adjust Accordingly</strong> - Query the controller + <strong>Detect Controller Capabilities and Adjust Accordingly</strong>. Query the controller about its capabilities in order to optimize the match between controller and game. For example, you may intend for a player to steer an object by waving the controller in the air. If a player's controller lacks accelerometer and gyroscope hardware, however, waving will not work. - When, however, your game queries the controller and discovers that motion detection is not - supported, it can switch over to an alternative, available control scheme. For more information - on querying controller capabilities, see <a href= + So, your game should query the controller and if motion detection is not + supported, switch over to an alternative, available control scheme. For more information + about querying controller capabilities, see <a href= "http://developer.android.com/training/game-controllers/compatibility.html">Supporting Controllers Across Android Versions</a>. </li> </ul> -<h3 id="back-button">Back-button behavior</h3> +<h3 id="back-button">Provide appropriate Back-button behavior</h3> <p> The Back button should never act as a toggle. For example, do not use it to both open and close a @@ -139,18 +139,18 @@ page.article=true </p> -<h3 id="multiple-controllers">Handling multiple controllers</h3> +<h3 id="multiple-controllers">Handle multiple controllers</h3> <p> When multiple players are playing a game, each with his or her own controller, it is important to - map each player-controller pair. For information on how to implement controller-number + map each player-controller pair. For information about how to implement controller-number identification, see <a href= "http://developer.android.com/reference/android/view/InputDevice.html#getControllerNumber">Input Devices</a>. </p> -<h3 id="handle-disconnect">Handling disconnects</h3> +<h3 id="handle-disconnect">Handle controller disconnects</h3> <p> When a controller is disconnected in the middle of gameplay, the game should pause, and a dialog @@ -159,7 +159,7 @@ page.article=true <p> The dialog should also offer troubleshooting tips (for example, a pop-up dialog telling the - player to "Check your Bluetooth connection"). For more information on implementing input-device + player to "Check your Bluetooth connection"). For more information about implementing input-device support, see <a href= "http://developer.android.com/training/game-controllers/controller-input.html">Handling Controller Actions</a>. Specific information about Bluetooth connections is at <a href= @@ -167,25 +167,53 @@ page.article=true </p> +<h3 id="ControllerHelp">Show controller instructions</h3> + +<p>If your game provides visual game control instructions, the +controller image should be free of branding and include only <a +href="{@docRoot}training/game-controllers/controller-input.html#button" +>buttons compatible with Android</a>.</p> + +<p>For sample images of an Android-compatible controller, download the +<a href="http://storage.googleapis.com/androiddevelopers/design/android_tv_gamepad_template-2014-10.zip" +>Android TV Gamepad Template (ZIP)</a>. +It includes a white controller on black background and a black controller on white background +(shown in figure 1), as a PNG file and an Adobe® Illustrator® file.</p> + +<img src="{@docRoot}images/games/game-controller-buttons_2x.png" width="700" + srcset="{@docRoot}images/games/game-controller-buttons_2x.png 2x, + {@docRoot}images/games/game-controller-buttons.png 1x" /> +<p class="img-caption"><b>Figure 1.</b> Example controller instructions using the +<a href="http://storage.googleapis.com/androiddevelopers/design/android_tv_gamepad_template-2014-10.zip" +>Android TV Gamepad Template (ZIP)</a>. + + + + <h2 id="manifest">Manifest</h2> +<p>There are a some special things games should include in the Android manifest.</p> + +<h3 id="Launcher">Show your game in the launcher</h3> <p> - The Android TV launcher home screen displays games in a separate row from regular apps. The TV - framework uses the <code>android:isGame</code> manifest attribute to differentiate games from - non-game apps. Set this value to <code>true</code> in your game's app manifest, as shown in the - following code example: + The Android TV launcher home screen displays games in a separate row from regular apps. + To make your game appear in the list of games, add the + <a href="{@docRoot}guide/topics/manifest/meta-data-element.html" + ><code><meta-data></code></a> tag in your app manifest with <code>android:name</code> + set to <code>"isGame"</code> and <code>android:value</code> + set to <code>"true"</code>. For example: </p> <pre class="fragment"> <application> ... - < meta-data android:name="isGame" android:value="true" > + <meta-data android:name="isGame" android:value="true" > ... </application> </pre> -<h3 id="gamepad">Game Controllers</h3> +<h3 id="gamepad">Declare support for game controllers</h3> <p> Games controllers may not be available or active for users of a TV device. In order to properly @@ -215,7 +243,9 @@ page.article=true <h2 id="gpgs">Google Play Game Services</h2> <p> - If your game integrates Google Play Game Services, you should keep in mind a number of + If your game integrates <a + href="https://developers.google.com/games/services/">Google Play Game services</a>, + you should keep in mind a number of considerations pertaining to achievements, sign-in, saving games, and multiplayer play. </p> @@ -224,7 +254,7 @@ page.article=true <p> Your game should include at least five (earnable) achievements. Only a user controlling gameplay - from a supported input device should be able to earn achievements. For more information on + from a supported input device should be able to earn achievements. For more information about achievements and how to implement them, see <a href= "https://developers.google.com/games/services/android/achievements">Achievements in Android</a>. </p> @@ -262,7 +292,7 @@ page.article=true <p> A game offering a multiplayer experience must allow at least two players to enter a room. For - further information on multiplayer games in Android, see the <a href= + further information about multiplayer games in Android, see the <a href= "https://developers.google.com/games/services/android/realtimeMultiplayer">Real-time Multiplayer</a> and <a href="">Turn-based Multiplayer</a> documentation on the Android developer site. diff --git a/docs/html/training/wearables/apps/index.jd b/docs/html/training/wearables/apps/index.jd index 7d961b7..256205b 100644 --- a/docs/html/training/wearables/apps/index.jd +++ b/docs/html/training/wearables/apps/index.jd @@ -1,5 +1,6 @@ page.title=Creating Wearable Apps -page.image=wear/images/notifications.png +page.tags="wear","wearable","app" +page.image=wear/images/01_create.png @jd:body diff --git a/docs/html/training/wearables/notifications/index.jd b/docs/html/training/wearables/notifications/index.jd index 17f3cb3..a7b6733 100644 --- a/docs/html/training/wearables/notifications/index.jd +++ b/docs/html/training/wearables/notifications/index.jd @@ -1,4 +1,6 @@ page.title=Adding Wearable Features to Notifications +page.tags="wear","notifications","wearables" +page.image=wear/images/01_notifications.png @jd:body <div id="tb-wrapper"> diff --git a/docs/html/training/wearables/notifications/stacks.jd b/docs/html/training/wearables/notifications/stacks.jd index e71e74c..9a528a4 100644 --- a/docs/html/training/wearables/notifications/stacks.jd +++ b/docs/html/training/wearables/notifications/stacks.jd @@ -45,7 +45,7 @@ final static String GROUP_KEY_EMAILS = "group_key_emails"; Notification notif = new NotificationCompat.Builder(mContext) .setContentTitle("New mail from " + sender1) .setContentText(subject1) - .setSmallIcon(R.drawable.new_mail); + .setSmallIcon(R.drawable.new_mail) .setGroup(GROUP_KEY_EMAILS) .build(); @@ -65,7 +65,7 @@ instead of as a new card:</p> Notification notif2 = new NotificationCompat.Builder(mContext) .setContentTitle("New mail from " + sender2) .setContentText(subject2) - .setSmallIcon(R.drawable.new_mail); + .setSmallIcon(R.drawable.new_mail) .setGroup(GROUP_KEY_EMAILS) .build(); diff --git a/docs/html/training/wearables/ui/index.jd b/docs/html/training/wearables/ui/index.jd index 8ef6fe7..5d97490 100644 --- a/docs/html/training/wearables/ui/index.jd +++ b/docs/html/training/wearables/ui/index.jd @@ -1,4 +1,5 @@ page.title=Creating Custom UIs for Wear Devices +page.image=wear/images/10_uilib.png @jd:body diff --git a/docs/html/wear/images/01_create.png b/docs/html/wear/images/01_create.png Binary files differnew file mode 100644 index 0000000..5a39dde --- /dev/null +++ b/docs/html/wear/images/01_create.png diff --git a/docs/html/wear/images/02_create.png b/docs/html/wear/images/02_create.png Binary files differnew file mode 100644 index 0000000..e722df1 --- /dev/null +++ b/docs/html/wear/images/02_create.png diff --git a/docs/html/wear/images/10_uilib.png b/docs/html/wear/images/10_uilib.png Binary files differnew file mode 100644 index 0000000..de7be57 --- /dev/null +++ b/docs/html/wear/images/10_uilib.png |